Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run custom hook when an event is received #17

Open
goodnessd opened this issue Mar 9, 2024 · 0 comments
Open

Run custom hook when an event is received #17

goodnessd opened this issue Mar 9, 2024 · 0 comments

Comments

@goodnessd
Copy link

Hello! I'm trying to connect a virtual user (VU) to my socket.io server that joins a room, waits for a message to be sent from the server to that room, and triggers a custom function on receiving that event.

The server has an external trigger that emits an event (fooEvent), and I want to inject a custom hook for some metric collection.

For example, I'd hope to do something like this:

scenarios:
 - name: new socket.io client listening for event 
       flow:
        - emit: ["join", "room1"]
           response:
             on: fooEvent
             function: myCustomFunction

A version of this question has already been asked here, but I believe my use case it subtly different.

All the examples that use response here seem to be dependent on an emit first, and none of them use functions in ./functions.js in the way that I'm trying to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant