public static function getEventQueue($name) { static $queues; // make queue if needed if (!isset($queues[$name])) { // get queue config $s = owa_coreAPI::serviceSingleton(); $map = $s->getMapValue('event_queues', $name); if ($map) { $implementation = $s->getMapValue('event_queue_types', $map['queue_type']); if ($implementation && isset($implementation[0]) && isset($implementation[1])) { owa_coreAPI::debug(print_r($implementation, true)); $queues[$name] = owa_lib::simpleFactory($implementation[0], $implementation[1], $map); } else { throw new Exception("No event queue by that type found."); } } else { throw new Exception("No configuration found for event queue {$name}."); } } // return queue return $queues[$name]; }