]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better queue manager detection, new method fail()
authorEvan Prodromou <evan@controlyourself.ca>
Wed, 1 Jul 2009 16:09:18 +0000 (12:09 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Wed, 1 Jul 2009 16:09:18 +0000 (12:09 -0400)
lib/queuemanager.php

index 6bb21de9b602dd3d09428a7212f78d337f528b4c..1bf4d4decc7ce1e81ec2a363d00e967ee342d57c 100644 (file)
@@ -39,22 +39,22 @@ class QueueManager
             if (Event::handle('StartNewQueueManager', array(&self::$qm))) {
 
                 $enabled = common_config('queue', 'enabled');
-                $type = common_config('queue', 'sub');
+                $type = common_config('queue', 'subsystem');
 
                 if (!$enabled) {
                     // does everything immediately
-                    return new UnQueueManager();
-                }
-
-                switch ($type) {
-                 case 'db':
-                    self::$qm = new DBQueueManager();
-                    break;
-                 case 'stomp':
-                    self::$qm = new StompQueueManager();
-                    break;
-                 default:
-                    throw new ServerException("No queue manager class for type '$type'");
+                    self::$qm = new UnQueueManager();
+                } else {
+                    switch ($type) {
+                     case 'db':
+                        self::$qm = new DBQueueManager();
+                        break;
+                     case 'stomp':
+                        self::$qm = new StompQueueManager();
+                        break;
+                     default:
+                        throw new ServerException("No queue manager class for type '$type'");
+                    }
                 }
             }
 
@@ -81,4 +81,9 @@ class QueueManager
     {
         throw ServerException("Unimplemented function 'done' called");
     }
+
+    function fail($object, $queue)
+    {
+        throw ServerException("Unimplemented function 'fail' called");
+    }
 }