[Twisted-web] Having reactor run at the main thread make
things harder for late adopters
george at ringdevelopment.com
Tue Nov 4 16:56:24 EST 2008
On Tue, 2008-11-04 at 23:03 +0200, Tzury Bar Yochay wrote:
> I am using (thread-safe) queue.Queue and have one for
> incoming-requests and another one for pending-responses.
> I have one thread which read on request at a time and handle it. once
> done, puts a response in the response-queue. Bare in mind that the
> response might be forwarded to another client or to the original
> sender depend on the case.
> If I won't find a decent way to hack this I might going to rewrite the
> more code than I can allow myself at this point of time.
This kind of thread work is what Twisted can do for you. Either do it
with threads or with Twisted. Queue may be more than you need to handle
the client-client connections.
Referring to the FAQ Glyph recommended to you,
Instead of broadcasting to a list of connections set up a method to
obtain the single appropriate connection and write to that.
Please respond only to the list.
More information about the Twisted-web