Re: [Twisted-Python] How to Solve a Problem Like Santa with Stackless and Twisted

2011-12-14 Thread Andrew Francis
Hi Glyph: Message: 3 Date: Tue, 13 Dec 2011 23:45:54 -0500 From: Glyph Subject: Re: [Twisted-Python] How to Solve a Problem Like Santa with     Stackless and Twisted To: Twisted general discussion Message-ID: Content-Type: text/plain; charset="iso-8859-1" On Dec 13, 2011, at 2:04

Re: [Twisted-Python] How to Solve a Problem Like Santa with Stackless and Twisted

2011-12-14 Thread Johann Borck
On 12/14/2011 05:45 AM, Glyph wrote: On Dec 13, 2011, at 2:04 PM, Andrew Francis wrote: Now at time T, there are eight reindeer and two elves ready. At T+1, an additional reindeer and elf are ready (their timestamps are the same, timer resolution notwithstanding). However the Twisted reactor

Re: [Twisted-Python] How to Solve a Problem Like Santa with Stackless and Twisted

2011-12-13 Thread Glyph
On Dec 13, 2011, at 2:04 PM, Andrew Francis wrote: > Now at time T, there are eight reindeer and two elves ready. At T+1, an > additional reindeer and elf are ready (their timestamps are the same, timer > resolution notwithstanding). However the Twisted reactor will serialise the > events and

Re: [Twisted-Python] How to Solve a Problem Like Santa with Stackless and Twisted

2011-12-13 Thread Andrew Francis
From: shhgs To: Andrew Francis ; Twisted general discussion Sent: Monday, December 12, 2011 11:15 PM Subject: Re: [Twisted-Python] How to Solve a Problem Like Santa with Stackless and Twisted Hi Shhgs: >defer.DeferredList(reindeers.values()).addCallback(lambda _ : >True).addCa

Re: [Twisted-Python] How to Solve a Problem Like Santa with Stackless and Twisted

2011-12-12 Thread shhgs
reindeers = dict( rudolf = defer.Deferred() , ) arrivedElvs = [] threeElvsArrived = defer.Deferred() def onReindeerArrive(who): reindeer[who].callback(True) def onElvArrive(elv): global arrivedElvs if len(arrivedElvs) <= 1: arrivedElvs.appe