Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-13 Thread benjamin.bertrand
: [Twisted-Python] client connecting to 2 servers (nonsimultaneously) Benjamin, sorry for providing you with an incorrect explanation.  Jean-Paul, thank you for correcting my broken understanding of callWhenRunning. Is there a call which puts a function into the reactor's queue of tasks to be comp

Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-12 Thread Jason Rennie
Great explanation. Thanks! Jason On Wed, Jan 12, 2011 at 4:40 PM, wrote: > Some reactors have a different implementation of wakeUp than the above, > but they all have the same goal. > > The reactor thread may be doing something which is going to block > indefinitely (WaitForMultipleObjects, se

Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-12 Thread exarkun
On 06:45 pm, jren...@gmail.com wrote: >On Wed, Jan 12, 2011 at 11:32 AM, Glyph Lefkowitz >wrote: >>The reactor doesn't have a queue of tasks to be completed. It has >>sets of >>various event sources, which it executes in no particular order. > >"queue of tasks" was a guess on my part, but I looke

Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-12 Thread Jason Rennie
On Wed, Jan 12, 2011 at 11:32 AM, Glyph Lefkowitz wrote: > The reactor doesn't have a queue of tasks to be completed. It has sets of > various event sources, which it executes in no particular order. > "queue of tasks" was a guess on my part, but I looked through the BaseReactor code and found s

Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-12 Thread Glyph Lefkowitz
On Wed, Jan 12, 2011 at 10:52 AM, Jason Rennie wrote: > Benjamin, sorry for providing you with an incorrect explanation. > Jean-Paul, thank you for correcting my broken understanding of > callWhenRunning. > > Is there a call which puts a function into the reactor's queue of tasks to > be complet

Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-12 Thread Jason Rennie
Benjamin, sorry for providing you with an incorrect explanation. Jean-Paul, thank you for correcting my broken understanding of callWhenRunning. Is there a call which puts a function into the reactor's queue of tasks to be completed? Thanks, Jason On Wed, Jan 12, 2011 at 10:26 AM, wrote: > A

Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-12 Thread exarkun
On 03:15 pm, jren...@gmail.com wrote: >Habit, mostly. I think it's a good habit, though. The reason is that >I >wanted to make sure the __init__ code completed before the connectTCP >was >called. In this case, it doesn't matter, but if I had a number of >things I >wanted to do in __init__, it

Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-12 Thread Jason Rennie
Habit, mostly. I think it's a good habit, though. The reason is that I wanted to make sure the __init__ code completed before the connectTCP was called. In this case, it doesn't matter, but if I had a number of things I wanted to do in __init__, it might matter. Consider: class MyClientProtoco

Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-12 Thread benjamin.bertrand
: den 11 januari 2011 14:11 Till: Twisted general discussion Ämne: Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously) You could probably generalize and simplify by using a collections.deque of hosts/ports and using the rotate() method before each reactor.connectTCP.   Also, no

Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously)

2011-01-12 Thread benjamin.bertrand
ailto:twisted-python-boun...@twistedmatrix.com] För Jason Rennie Skickat: den 11 januari 2011 14:11 Till: Twisted general discussion Ämne: Re: [Twisted-Python] client connecting to 2 servers (nonsimultaneously) You could probably generalize and simplify by using a collections.deque of hosts/p