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
I'm trying to run EventMachine on an webserver that use Puma in cluster mode (so multiple workers are started), and that's running a Rails application and I found it hard to realize where should I start the EM.run { ... }, because I needed as a long running process because is needed to process messages using another gem called Faye.
If a put it in an rails initializer it seems that the code run every time a puma worker is spawned, so if I have multiple 4 workers, there will be 4 times that a code like this runs:
I'm trying to run EventMachine on an webserver that use Puma in cluster mode (so multiple workers are started), and that's running a Rails application and I found it hard to realize where should I start the
EM.run { ... }
, because I needed as a long running process because is needed to process messages using another gem called Faye.If a put it in an rails initializer it seems that the code run every time a puma worker is spawned, so if I have multiple 4 workers, there will be 4 times that a code like this runs:
Is this a correct way to start only one EM? or how I should approach this? any pointer is appreciate it :)! thankss
The text was updated successfully, but these errors were encountered: