I am new to web-stack programming and my naive implementation of websockets server is not working. I took chat server (chat_explore.jl) from WebSockets.jl examples here (chat_explore.html is needed to run the code below): https://github.com/JuliaWeb/WebSockets.jl/tree/master/examples
My aim here - i want to process the input from connected users and perform some simulations based on the text commands i receive from them. So, i have modified the original chat_explore.jl example to put connected users’ messages into a queue and then process it within server_loop(). I guess i did not make proper synchronization between async tasks here or something else, any suggestions from your will be greatly appreciated. Here is the code:
If i remove my server_loop() function everything works just fine and i can extract user commands from queue Buffer.
Thank you very much in advance for any suggestions!