Is it possible to have two Coroutines print to the...
# coroutines
n
Is it possible to have two Coroutines print to the console at the same time (in a queue), while one is reading keyboard input from the console?
o
sure, what makes you think it wouldn't be? the system streams are already thread-safe
n
Basic Websocket client that sends messages to the server and receives responses back in the console.
n
A
select
might work for this.
o
also, you do mean to make two requests here, right? not one combined websocket?
n
In the example there are two WebSocket sessions.
o
I can't see anything immediately obvious that would make this not work. assuming your
/ws/echo
endpoint doesn't echo it to all sessions though, you won't see anything. if it does, I'd have to setup the code to see what's not working
n
The server will echo to all sessions pointing to the same path.
Revised version of WebSocket client example where WebSocket input/output works as expected with the console concurrently.