Thanks Moe, the example seems to work, which is nice ;-) If I understand well DeferredSemaphore(x) guarantees that no more than x concurent calls that acquired it will be run together. Am I wrong when inferring that DeferredList is not compulsory ? And that I adding calls to the semaphore as I need them will ensure the behaviour I want (as my tasks come, acquire the semaphore, then release it) ?
----- Message d'origine ---- De : Moe Aboulkheir email@example.com À : firstname.lastname@example.org Envoyé le : Jeudi, 11 Mai 2006, 5h56mn 52s Objet : Re: Re : [Twisted-Python] Multiple thread pools
On Thu, 11 May 2006 15:32:08 +0000 (GMT), Stéphane Brault email@example.com wrote:
Hi, I can see now how 'untwisted' my threads concerns are, please forget my newbie ununderstanding ;-) Still, I need to ensure that I won't have more than x similar calls at a time. Is there a way, maybe using some of the deferred classes (deferredqueue,..) to ensure that there is no more than x simultaneous similar calls (wrapped in deferreds), the others being pending, until one is finished
I think twisted.internet.defer.DeferredSemaphore is what you're looking for. There is an example (someone else's example) of using it to do something similar here: http://pastebin.com/702986
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python