Managing Multiple Clients Event Loops

3 views
Skip to first unread message

glen

unread,
Nov 12, 2009, 6:48:53 AM11/12/09
to EventMachine
Hi

I have an EM Server which connects to two other EM Server's through EM
Clients ( I prefer EM Clients as they are faster) and send a single
response back.

Now in the receive_data callback of each EM.client I need to break out
of the EM.run loop, hence i'm using EM.stop. However this stops the EM
Server.

Is there a way that I can stop specific EM.run loops?

Thanks
Glen

Aman Gupta

unread,
Nov 22, 2009, 6:55:26 PM11/22/09
to EventMachine
EM does not currently support multiple loops, there is only ever one
global loop. Subsequent calls to EM.run are no-ops.

What are you trying to do? You can close client connections by calling
close_connection_after_writing.

Aman

glen

unread,
Nov 23, 2009, 7:23:09 AM11/23/09
to EventMachine
Hi Aman,
I was trying to query two databases (for now - there may be more in
the future) with the same data. The two databases may give me
different results which i collate and send back as a response.

The idea was to use EM Servers and EM Clients all over. However since
this was not possible, have switched to evma_httpserver.

Thanks.
Glen
Reply all
Reply to author
Forward
0 new messages