summaryrefslogtreecommitdiff
path: root/lib/queuemanager.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2010-01-23 01:03:41 -0500
committerCraig Andrews <candrews@integralblue.com>2010-01-23 01:03:41 -0500
commit23c0d663d63c49183494ebb049160af633a2d2ec (patch)
tree91b93d4c73d5af935e4629dd09ea3800713d76c4 /lib/queuemanager.php
parent845f051c2f85248ef85d0a34f032792ca83f04a4 (diff)
Allow for instances as well as class names to be passed as queue handlers and iomanagers.
Diffstat (limited to 'lib/queuemanager.php')
-rw-r--r--lib/queuemanager.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/queuemanager.php b/lib/queuemanager.php
index 4eb39bfa8..b2e86b127 100644
--- a/lib/queuemanager.php
+++ b/lib/queuemanager.php
@@ -181,7 +181,9 @@ abstract class QueueManager extends IoManager
{
if (isset($this->handlers[$queue])) {
$class = $this->handlers[$queue];
- if (class_exists($class)) {
+ if(is_object($class)) {
+ return $class;
+ } else if (class_exists($class)) {
return new $class();
} else {
common_log(LOG_ERR, "Nonexistent handler class '$class' for queue '$queue'");
@@ -242,7 +244,7 @@ abstract class QueueManager extends IoManager
* Only registered transports will be reliably picked up!
*
* @param string $transport
- * @param string $class
+ * @param string $class class name or object instance
* @param string $group
*/
public function connect($transport, $class, $group='queuedaemon')