[Twisted-Python] how to get an idle callback while running a reactor?

Joe Strout joe at strout.net
Sat Dec 20 14:26:48 EST 2008


Christopher Armstrong wrote:

> Just because you have a number of sources doesn't mean you
> intrinsically can't use them in an efficient, event-oriented manner.

No, but when these "sources" as you call them are external data sources 
that I have to periodically check (have to -- there is no way to make 
these external contact my app when something changes), that is 
inherently a polling situation.

> And you don't need a time-based call *just* because you have more than
> one interface to the bot.

True; that just makes it easier.

> Change in the temperature - How does your thermostat communicate this
> information?

I'm accessing a web service.

> Stock price - same question.

Same answer.  These services give you an answer when you ask for them; 
they don't come to you when a value changes.

Anyway, I think I have the answer I need 
(twisted.internet.task.LoopingCall), and I thank you all for it.


Best,
- Joe





More information about the Twisted-Python mailing list