src/Qutee/Queue.php
static public function factory($config = array())
    {
        if (isset($config['persistor'])) {
            $persistorClass = 'Qutee\\Persistor\\'. ucfirst($config['persistor']);
            if (class_exists($persistorClass)) {
                $persistor = new $persistorClass;
            } elseif (class_exists($config['persistor'])) {
                $persistor = new $config['persistor'];
            }

            if (!isset($persistor) || !is_object($persistor)) {
                throw new \InvalidArgumentException(sprintf('Persistor "%s" doesn\'t exist', $config['persistor']));
            } elseif (!($persistor instanceof Persistor\PersistorInterface)) {
                throw new \InvalidArgumentException(sprintf('Persistor "%s" does not implement Persistor\PersistorInterface', $config['persistor']));
            }

            if (isset($config['options'])) {
                $persistor->setOptions($config['options']);
            }
        } else {
            // Default persistor
            $persistor = new \Qutee\Persistor\Memory;
        }

        $queue = new self;
        $queue->setPersistor($persistor);

        return $queue;
    }
static public function factory($config = array())
    {
        if (isset($config['persistor'])) {
            $persistorClass = 'Qutee\\Persistor\\'. ucfirst($config['persistor']);
            if (class_exists($persistorClass)) {
                $persistor = new $persistorClass;
            } elseif (class_exists($config['persistor'])) {
                $persistor = new $config['persistor'];
            }

            if (!isset($persistor) || !is_object($persistor)) {
                throw new \InvalidArgumentException(sprintf('Persistor "%s" doesn\'t exist', $config['persistor']));
            } elseif (!($persistor instanceof Persistor\PersistorInterface)) {
                throw new \InvalidArgumentException(sprintf('Persistor "%s" does not implement Persistor\PersistorInterface', $config['persistor']));
            }

            if (isset($config['options'])) {
                $persistor->setOptions($config['options']);
            }
        } else {
            // Default persistor
            $persistor = new \Qutee\Persistor\Memory;
        }

        $queue = new self;
        $queue->setPersistor($persistor);

        return $queue;
    }
Create queue

@param array $config:
persistor: name of the persistor adapter
options:   array with options for the persistor

@return \Qutee\Queue
@throws \InvalidArgumentException