You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! Been testing out the module and gotten it working using the build available in #15 with xk6 to connect to a single SSE endpoint, but when I'm trying to expand that to include multiple SSE endpoints the connection appears to "block" the Event Loop until client.close() is called.
Any recommendations on what I might be doing wrong? Might just be that the module isn't setup for that at this time, I tried looking around but I'm not very experienced with Go/k6 extension development so not sure where to start with a PR to add that functionality yet.
Here's a quick test script of what I'm looking for. In this I'd like both of the SSE connections to occur in parallel as my app will be getting data from multiple SSE endpoints at once. In the example below you'll notice that the connection isn't made to url2 until the first SSE connection is closed due to an event.id value of 4 being sent by https://echo.websocket.org/.sse. Given this my console output looks like this:
You can see from the above that the call to sse.open(...) appears to be blocking the event loop as the next line console.log('started sse1') isn't executed until after the client.close() function is called.
And disturbingly, the WebSocket's docs (https://grafana.com/docs/k6/latest/using-k6/protocols/websockets/) says " the run function will be immediately called, all code inside it will be executed (usually code to set up event handlers), and then blocked until the WebSocket connection is closed". I guess their async stuff has a ways to go....
Hi there! Been testing out the module and gotten it working using the build available in #15 with xk6 to connect to a single SSE endpoint, but when I'm trying to expand that to include multiple SSE endpoints the connection appears to "block" the Event Loop until
client.close()
is called.Any recommendations on what I might be doing wrong? Might just be that the module isn't setup for that at this time, I tried looking around but I'm not very experienced with Go/k6 extension development so not sure where to start with a PR to add that functionality yet.
Here's a quick test script of what I'm looking for. In this I'd like both of the SSE connections to occur in parallel as my app will be getting data from multiple SSE endpoints at once. In the example below you'll notice that the connection isn't made to
url2
until the first SSE connection is closed due to anevent.id
value of4
being sent byhttps://echo.websocket.org/.sse
. Given this my console output looks like this:Current Console Output
You can see from the above that the call to
sse.open(...)
appears to be blocking the event loop as the next lineconsole.log('started sse1')
isn't executed until after theclient.close()
function is called.Example Script
The text was updated successfully, but these errors were encountered: