Add UnQueueManager for immediate handling

Perhaps it's a little precious, but I took out the switches in
util.php to determine what's supposed to be sent when, and made
a queuemanager class that will just do things when they're supposed to
be done.
This commit is contained in:
Evan Prodromou
2009-07-01 11:34:12 -04:00
parent 7b66a12913
commit e0bf8ad95b
3 changed files with 112 additions and 74 deletions

View File

@@ -36,9 +36,15 @@ class QueueManager
{
if (empty(self::$qm)) {
$type = common_config('queue', 'sub');
if (Event::handle('StartNewQueueManager', array(&self::$qm))) {
if (Event::handle('StartNewQueueManager', array($type, &self::$qm))) {
$enabled = common_config('queue', 'enabled');
$type = common_config('queue', 'sub');
if (!$enabled) {
// does everything immediately
return new UnQueueManager();
}
switch ($type) {
case 'db':