summaryrefslogtreecommitdiff
path: root/lib/queuehandler.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-04-23 10:08:26 +0000
committerEvan Prodromou <evan@controlyourself.ca>2009-04-23 10:08:26 +0000
commit7c383dc1d46cae8abc6d1e5c7eb93ad7cdd91f63 (patch)
tree520fa94d17baf2a91c905932cb40792dba5503f4 /lib/queuehandler.php
parenta3e727823d01ed9fd5f440eeaf27449092309865 (diff)
alert to what transport we're checking for
Diffstat (limited to 'lib/queuehandler.php')
-rw-r--r--lib/queuehandler.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/queuehandler.php b/lib/queuehandler.php
index 9ce9e32b3..fde650d9e 100644
--- a/lib/queuehandler.php
+++ b/lib/queuehandler.php
@@ -36,7 +36,7 @@ class QueueHandler extends Daemon
$this->set_id($id);
}
}
-
+
function class_name()
{
return ucfirst($this->transport()) . 'Handler';
@@ -46,7 +46,7 @@ class QueueHandler extends Daemon
{
return strtolower($this->class_name().'.'.$this->get_id());
}
-
+
function get_id()
{
return $this->_id;
@@ -56,16 +56,16 @@ class QueueHandler extends Daemon
{
$this->_id = $id;
}
-
+
function transport()
{
return null;
}
-
+
function start()
{
}
-
+
function finish()
{
}
@@ -74,14 +74,14 @@ class QueueHandler extends Daemon
{
return true;
}
-
+
function run()
{
if (!$this->start()) {
return false;
}
- $this->log(LOG_INFO, 'checking for queued notices');
$transport = $this->transport();
+ $this->log(LOG_INFO, 'checking for queued notices for "' . $transport . '"');
do {
$qi = Queue_item::top($transport);
if ($qi) {
@@ -113,7 +113,7 @@ class QueueHandler extends Daemon
} else {
$this->clear_old_claims();
$this->idle(5);
- }
+ }
} while (true);
if (!$this->finish()) {
return false;
@@ -127,7 +127,7 @@ class QueueHandler extends Daemon
sleep($timeout);
}
}
-
+
function clear_old_claims()
{
$qi = new Queue_item();
@@ -137,10 +137,9 @@ class QueueHandler extends Daemon
$qi->free();
unset($qi);
}
-
+
function log($level, $msg)
{
common_log($level, $this->class_name() . ' ('. $this->get_id() .'): '.$msg);
}
}
- \ No newline at end of file