[Twisted-Python] How Twisted is This?
brad at bbnet.ca
Wed Jul 16 12:04:30 EDT 2003
On Wed, Jul 16, 2003 at 05:45:04PM +0200, Ivo van der Wijk wrote:
> On Wed, Jul 16, 2003 at 11:25:20AM -0400, Brad Bollenbach wrote:
[snippity snip snip]
> > So, my main use case (possibly) relevant to Twisted would be:
> > I write a "monicron". monicron wakes up every five minutes and asks the
> > system "are there any monitors that need to be performed right now?" The
> > answer will either be "Yes, here's the monitors that need to be
> > performed right now" or "No".
> > If No, monicron will just go back to bed for another five minutes.
> > If the answer is Yes monicron will gather the monitors that need to be
> > run, and execute the all at once -- asyncronously. It would then need to
> > collect the results of all the monitors, and once they've all reported
> > back for a given site, send an error report if something went wrong.
> > 1. Does this sound Twisted?
> Somewhat. You need to make very sure your system doesn't block unexpectedly :)
I'm not sure how you (or Twisted) define "unexpected", but I probably
want things to block when -- for example -- I try to retrieve a page
from a certain URL.
I certainly don't want to be writing state machines.
> > 2. If Yes, where should I start looking for the bits of the framework
> > that will make my task as easy as possible?
> I have a rather ugly Twisted script which might give you a start (it does the
> checking at intervals, gathering results / setting timeouts, etc).
> If you're interested, I could try to cleanup the code a bit.
Yeah, I'd be interested in looking at that.
More information about the Twisted-Python