[Twisted-Python] How Twisted is This?

Moshe Zadka m at moshez.org
Wed Jul 16 09:52:50 MDT 2003


On Wed, 16 Jul 2003, Brad Bollenbach <brad at bbnet.ca> wrote:

> * branded for the company I work for 

I'm not sure what this means.

> * multiuser 

I'm not sure what this mean either.

> * offer various ways of verifying the uptime and integrity of content on
> a site:
> 
>     i. Can I open an HTTP connection to this site?
>     ii. Is "foo bar" present on the page that I've retrieved?
>     iii. Is the page I've retrieved the same size as it was before?
>     iv. Is Basic Auth still working with this username/password? (for
>     pages that do Basic Auth, of course :)

Look at twisted.web.monitor.
Basically, most of this is fairly easy with Twisted.

> 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.

That sounds like the worst impelemntation strategy I could think
of. Wouldn't it be saner to have each task have its own scheduling?

> 2. If Yes, where should I start looking for the bits of the framework
> that will make my task as easy as possible?

Read the documentation?
Seriously, read all of it. I can't imagine many parts which wouldn't
be relevant.
-- 
Moshe Zadka -- http://moshez.org/
Buffy: I don't like you hanging out with someone that... short.
Riley: Yeah, a lot of young people nowadays are experimenting with shortness.
Agile Programming Language -- http://www.python.org/




More information about the Twisted-Python mailing list