On 01:26 am, mithra...@mithrandi.net wrote:
>On Thu, Oct 29, 2009 at 8:38 PM, Brian Granger
> wrote:
>>One question though - can someone explain the need/usage cases for
>>task.Clock and the other things in task?
>
>Clock is a "fake" IReactorTime implementation; as the docstring says,
>it is inten
On Thu, Oct 29, 2009 at 8:38 PM, Brian Granger wrote:
> One question though - can someone explain the need/usage cases for
> task.Clock and the other things in task?
Clock is a "fake" IReactorTime implementation; as the docstring says,
it is intended for writing unit tests where you want control
> Hi Brian
>
> Forgive me for butting in, but why :-)
>
>
Helpful butting in is more than fine..
> Importing the reactor is no big deal, and if you use task.deferLater, apart
> from not having to write any code you also have the advantage of being able
> to pass it a result that the deferred
> "Brian" == Brian Granger writes:
Brian> I looked at deferLater, but am not using it right now. The sleep
Brian> function I am using is basically the same as this - in my case
Brian> "sleep" turned out to be a little simpler because I don't have to
Brian> create and pass the clock around. B
Glyph,
In general, please reply on this list inline, with quoting and trimming,
> like so:
>
> http://en.wikipedia.org/wiki/Posting_style#Inline_replying
>
> This might seem like a minor thing, but it really helps those of us who
> have to follow long discussions and many mailing lists.
>
So
Hi Brian,
In general, please reply on this list inline, with quoting and
trimming, like so:
http://en.wikipedia.org/wiki/Posting_style#Inline_replying
This might seem like a minor thing, but it really helps those of us
who have to follow long discussions and many mailing lists.
Now,
I have been using Twisted for years but only recently began to use
inlineCallbacks (couldn't give up Python 2.4 support until recently). This
simple asynch. sleep function is fantastic. Just today I used to it with
inlineCallbacks to dramatically clean up some complex deferred logic.
Thanks,
Bri
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
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
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
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
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
__
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):
>>>
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
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
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
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
17 matches
Mail list logo