[Twisted-Python] Passing messages from HTTP Request to another factory or protocol

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Wed Nov 18 15:09:33 MST 2009


On 09:46 pm, don at delphexonline.com wrote:
>Here is what I have done so far...
>
>I have a dequeued collection that can be accessed by all the relevant
>classes. On the one end the HTTP Server appends items to this queue 
>when
>it receives a valid HTTP request. On the other end, the SSMI client 
>pops
>these items from the queue on a 5 seconds "callLater" based deferred 
>and
>sends it out over the existing TCP connection.
>
>Now this works, but I'm wondering if there is not a better way.

If you use twisted.internet.defer.DeferredQueue (or any other "push" 
event-driven mechanism) then you can eliminate the 5 second polling 
loop.

Jean-Paul




More information about the Twisted-Python mailing list