[Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread Paul Thomas
Is there any way to do something like "yield sleep(10)" inside an @inlineCallbacks method? ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread Paul Thomas
On 7 Oct 2009, at 20:30, Paul Thomas wrote: > Is there any way to do something like "yield sleep(10)" inside an > @inlineCallbacks method? I realise I can do this: def sleep(seconds): d = defer.Deferred() reactor.callLater(seconds, d.callback, seconds) return d but I wondered

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread Matt Perry
reactor.callLater() is the best way to delay a certain function call. sleep() will block the entire program from running, which you probably don't want to do. On Wed, Oct 7, 2009 at 3:35 PM, Paul Thomas wrote: > > On 7 Oct 2009, at 20:30, Paul Thomas wrote: > > > Is there any way to do something

Re: [Twisted-Python] Problem with XMLRPC resource wrapped with guard basic auth

2009-10-07 Thread asset
I was indeed being tricked. I actually tested soap with a real client, but with xmlrpc i was using the browser. I was expecting to see the same error message, and instead got a new one that was presented by the modifications I pulled out of the trunk to support the issue in #4014. I was expect

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread Phil Christensen
On Oct 7, 2009, at 3:46 PM, Matt Perry wrote: > On 7 Oct 2009, at 20:30, Paul Thomas wrote: >> Is there any way to do something like "yield sleep(10)" inside an >> @inlineCallbacks method? >> >> I realise I can do this: >> >> def sleep(seconds): >> d = defer.Deferred() >> reactor.callLater

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread exarkun
On 10:04 pm, p...@bubblehouse.org wrote: >On Oct 7, 2009, at 3:46 PM, Matt Perry wrote: >>On 7 Oct 2009, at 20:30, Paul Thomas wrote: > >>>Is there any way to do something like "yield sleep(10)" inside an >>>@inlineCallbacks method? >>> >>>I realise I can do this: >>> >>>def sleep(seconds): >>>

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread Kevin Horn
On Wed, Oct 7, 2009 at 5:29 PM, wrote: > Recent versions of Twisted include twisted.internet.defer.deferLater, a > function rather similar to the sleep function defined above. > > Jean-Paul > > Do you mean twisted.internet.task.deferLater? Or am I missing something? Kevin Horn __

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread exarkun
On 7 Oct, 10:40 pm, kevin.h...@gmail.com wrote: >On Wed, Oct 7, 2009 at 5:29 PM, wrote: >>Recent versions of Twisted include twisted.internet.defer.deferLater, >>a >>function rather similar to the sleep function defined above. >> >>Jean-Paul >Do you mean twisted.internet.task.deferLater? >Or am I

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread Mikhail Terekhov
On Wed, Oct 7, 2009 at 6:04 PM, Phil Christensen wrote: > > Paul's example will work just fine. Also, AFAIK there's no existing > twisted function to do replicate an asynchronous sleep() in this way. > > -phil > What about Deferred.setTimeout? http://twistedmatrix.com/documents/current/api/twiste

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread Glyph Lefkowitz
On Wed, Oct 7, 2009 at 11:08 PM, Mikhail Terekhov wrote: > > What about Deferred.setTimeout? > http://twistedmatrix.com/documents/current/api/twisted.internet.defer.Deferred.html#setTimeout > IMHO it solves similar problem. > Deferred.setTimeout does something else. More importantly, it is depr

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread Andrew Bennetts
Mikhail Terekhov wrote: >On Wed, Oct 7, 2009 at 6:04 PM, Phil Christensen <[1]p...@bubblehouse.org> >wrote: > > Paul's example will work just fine. Also, AFAIK there's no existing > twisted function to do replicate an asynchronous sleep() in this way. > > -phil > >What

Re: [Twisted-Python] PB vs JMS

2009-10-07 Thread Jacopo Pecci
On Mon, Oct 5, 2009 at 8:21 PM, Drew Smathers wrote: > > > On Mon, Oct 5, 2009 at 9:14 AM, wrote: >> >> I looked at PB for an architecture with one client distributing some >> processing to several servers. Now I came across JMS and I have seen that >> using ActiveMQ with the Stomp protocol there