Best pick for time-based 'event' looping?

Martin Robertson mansionhouseprojects at googlemail.com
Thu Apr 16 10:56:21 BST 2009


T'was a few years since I used this,
& the namespace has changed,
but perhaps of some use? :

http://search.cpan.org/~lembark/Parallel-Queue-2.01/

mart.

2009/4/16 Randy J. Ray <rjray at blackperl.com>:
> I might be using the wrong tech-terminology here, so bear with me...
>
> What I'm looking for is a best-of-breed sort of CPAN solution for a
> job-queue processor in which the jobs are run based on time. Not quite
> "cron", mind you, but not too different from that. In essence:
>
> 1. Init job queue
> 2. Add first task, which should happen immediately
> 3. (Loop starts here) Queue/Event-handler knows how long it has to
>   wait before peeling the next task off the head of the queue and
>   processing it.
> 4. Task runs, might insert some new, different tasks with their
>   own offset-from-now values expressed in seconds. For example, the
>   main task re-inserts itself to run again in 15 minutes, after it
>   has checked a certain RSS feed for Last-Updated and possibly read
>   it and parsed it.
> 5. Loop back to #3
> 6. Profit (this step is never actually reached)
>
> Right now, the application (the twitter-bot behind the "cpan_linked" Twitter
> account) has a really clumsy time-based loop. I'm planning on adding some
> more functionality to it (anwering @-messages, allowing me to control it
> remotely with direct messages, etc.), and it would be a good time to replace
> this loop with something less, well, hideous. Something I wouldn't be
> embarrassed to have on CPAN...
>
> Randy
> --
> rjray at blackperl.com
>



More information about the london.pm mailing list