Reputation: 43
When starting multiple listening sockets "servers" inside the reactor loop - is it safe to assume that a block happening in one of the listening socket callbacks to cause the other sockets to stop accepting new connections, since the reactor loop will be blocked ?
Is it then best practice to start a separate ruby process per listening socket or are there alternatives to better handle this use case?
Upvotes: 1
Views: 284
Reputation: 4900
Sockets will still accept connections, but reactor will be blocked if any single server blocks and no data will be passed to other servers. It's not a bad idea to spawn a new process. And it's even a better idea to avoid blocking operation in callbacks.
Upvotes: 1