Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timed Tasks (cron-like) in PHP

Is there a full featured, job scheduling package available for PHP? I'm looking for the PHP equivalent to Java's Quartz. I'm fine having things triggered externally from cron to drive the system. The functionality I'd be looking for:

  • Ability to register task (class/method) to be called at given intervals.
  • Ability to specify whether a given task can be run multiple times (potentially long running methods should not be run multiple times in certain cases).
  • All registered entries/methods could be run in parallel (jobs are backgrounded so that they do not block other timed tasks).
  • Ability to set a timeout for a given task.
  • Ability to update job control dynamically, so for instance you could disable some tasks or change their frequency without code changes.

I know it is a lot to ask, but it seems like a useful batch of features and I thought someone might have put together some portion of them.

If this or some portion of this does not already exist, any pointers to putting one together or an open source project that has a reasonably featureful implementation of some subset of these?

like image 690
Tim Avatar asked Nov 25 '08 18:11

Tim


1 Answers

A quick google turns up a few decent results:

  • http://www.bitfolge.de/pseudocron-en.htm
  • http://www.phpclasses.org/browse/package/4140.html
  • http://www.hotscripts.com/Detailed/61437.html

Really, though, if you're on any decent shared hosting package you should have access to some sort of task scheduler be it Windows' Task Scheduler or cron under *nix. I know DreamHost allows user level crontabs, at least.

like image 67
willasaywhat Avatar answered Sep 28 '22 07:09

willasaywhat