Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Mojolicious: Websocket example under hypnotoad

by Corion (Pope)
on Jul 09, 2014 at 09:40 UTC ( #1092872=note: print w/replies, xml ) Need Help??


in reply to Re^2: Mojolicious: Websocket example under hypnotoad
in thread Mojolicious: Websocket example under hypnotoad

I think you will have to add much more session handling and inter-server communication for making the "real-time" aspect of WebSockets work across multiple processes. Personally, I would try really hard to avoid this, for example by moving the non-WebSocket parts of your application to a different machine/CPU/process.

If you still want to go the route of keeping one WebSocket open to each client but have communication between them, you will need to have communication between your server processes too, to move the information from the other parts of your application to the process that holds the socket of the client. I think this is where message brokers like ZeroMQ come in to make IPC easier. Other people use HTTP as their internal transport ("SOA" respectively "microservices").

I think that the multi-process approach massively complicates your infrastructure and setup, but if there is no easy way to handle this within one process then you'll have to look in that direction.

  • Comment on Re^3: Mojolicious: Websocket example under hypnotoad

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1092872]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2020-07-11 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?