On 13 Mag, 23:25, Jean-Paul Calderone <exar...@divmod .comwrote:
Yes but how do you know when it's the time to fire up a call without
using a thread?
You are forced to call time.time() periodically and check if that time
had come every time.
Take a look at twisted/internet/base/ReactorBase.run UntilCurrent.
That's where that should happen.
--- Giampaolo
On Tue, 13 May 2008 14:05:43 -0700 (PDT), Giampaolo Rodola' <gne...@gmail.c omwrote:
>
>
>
>
>
>
To support scheduling calls, you just have to know when the next call is
going to happen. Then, you can wake up at exactly that time. This is
what Twisted does, even for select reactor. ;)
On 13 Mag, 22:16, Jean-Paul Calderone <exar...@divmod .comwrote:
On Tue, 13 May 2008 11:50:30 -0700 (PDT), Giampaolo Rodola' <gne...@gmail.c omwrote:
On 13 Mag, 17:59, Josiah Carlson <josiah.carl... @gmail.comwrote :
On 13 Mag, 17:59, Josiah Carlson <josiah.carl... @gmail.comwrote :
We do not live in a pure world, Python isn't pure (practicality beats
purity), and by attempting to send some data each time a .push*()
method is called, there are measurable increases in transfer rates.
purity), and by attempting to send some data each time a .push*()
method is called, there are measurable increases in transfer rates.
Good point. I'd like to ask a question: if we'd have a default
asyncore.loop timeout of (say) 0.01 ms instead of 30 could we avoid
such problem?
I've always found weird that asyncore has such an high default timeout
value.
Twisted, for example, uses a default of 0.01 ms for all its reactors.
asyncore.loop timeout of (say) 0.01 ms instead of 30 could we avoid
such problem?
I've always found weird that asyncore has such an high default timeout
value.
Twisted, for example, uses a default of 0.01 ms for all its reactors.
I'm not sure this is right. What timeout are we talking about? Twisted
only wakes up when necessary.
only wakes up when necessary.
Jean-Paul
I'm talking about the asyncore.loop timeout parameter which defaults
to 30 (seconds).
I don't think that Twisted only wakes up when necessary (surely not by
using the select reactor).
Think about the schedule calls feature (reactor.callLa ter).
To have that work I guess that a continuous loop must always be kept
alive, regardless of the reactor used.
to 30 (seconds).
I don't think that Twisted only wakes up when necessary (surely not by
using the select reactor).
Think about the schedule calls feature (reactor.callLa ter).
To have that work I guess that a continuous loop must always be kept
alive, regardless of the reactor used.
To support scheduling calls, you just have to know when the next call is
going to happen. Then, you can wake up at exactly that time. This is
what Twisted does, even for select reactor. ;)
using a thread?
You are forced to call time.time() periodically and check if that time
had come every time.
Take a look at twisted/internet/base/ReactorBase.run UntilCurrent.
That's where that should happen.
--- Giampaolo