[Catalyst] [RFC] C::P::Scheduler - cron-like scheduling of events
Matt S Trout
dbix-class at trout.me.uk
Wed Dec 14 00:56:24 CET 2005
On Mon, Dec 12, 2005 at 09:55:35PM -0500, Andy Grundman wrote:
> Adam Herzog wrote:
> >In regards to this, is the only problem that the request will take a
> >long time? Some of the events may be long running, but if it was
> >executed on the requests from the system cron, then I don't care. So,
> >would/could it be possible to have the scheduler only run if a specific
> >controller or path were requested? Or, perhaps, only for requests from a
> >certain IP (ie localhost)...
>
> Yeah this is workable. The plugin can support 2 kinds of events: those
> that run automatically at certain intervals and those that must be run
> manually. And your IP restriction idea would work for manually allowing
> events to be run.
>
> I think the easiest way to do this would be to use the "trigger" idea
> mentioned earlier, and not directly call the method, but use a param to
> trigger the event.
>
> http://www.myapp.com/?schedule_trigger=send_all_email
>
> The other option is to use a custom attribute for methods that perform
> scheduled events, but I think that's a lot more work to implement, and
> would not allow coderefs to be run this way.
>
> Ideas?
Pass it a Catalyst::Action object - controller methods become those in
the dispatcher already and that can be used to store the attributes. Would
be amenable to constructing from controllers, YAML, or from the db that
way too I think ...
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Catalyst
mailing list