- function __construct($id=null, $daemonize=true)
- {
- parent::__construct($daemonize);
-
- if ($id) {
- $this->set_id($id);
- }
- }
-
- /**
- * How many seconds a polling-based queue manager should wait between
- * checks for new items to handle.
- *
- * Defaults to 60 seconds; override to speed up or slow down.
- *
- * @return int timeout in seconds
- */
- function timeout()
- {
- return 60;
- }
-
- function class_name()
- {
- return ucfirst($this->transport()) . 'Handler';
- }
-
- function name()
- {
- return strtolower($this->class_name().'.'.$this->get_id());
- }
-
- /**
- * Return transport keyword which identifies items this queue handler
- * services; must be defined for all subclasses.
- *
- * Must be 8 characters or less to fit in the queue_item database.
- * ex "email", "jabber", "sms", "irc", ...
- *
- * @return string
- */
- function transport()
- {
- return null;
- }
-
- /**
- * Initialization, run when the queue handler starts.
- * If this function indicates failure, the handler run will be aborted.
- *
- * @fixme run() will abort if this doesn't return true,
- * but some subclasses don't bother.
- * @return boolean true on success, false on failure
- */
- function start()
- {
- }
-
- /**
- * Cleanup, run when the queue handler ends.
- * If this function indicates failure, a warning will be logged.
- *
- * @fixme run() will throw warnings if this doesn't return true,
- * but many subclasses don't bother.
- * @return boolean true on success, false on failure
- */
- function finish()
- {
- }
-