public function send($message, Zend_Queue $queue=null)
    {
        if ($queue === null) {
            $queue = $this->_queue;
        }

        $queueName = $queue->getName();

        if (!$this->isExists($queueName)) {
            require_once 'Zend/Queue/Exception.php';
            throw new Zend_Queue_Exception('Queue does not exist:' . $queueName);
        }

        if (!isset($this->_queueObjects[$queueName])) {
            $this->_queueObjects[$queueName] = new Rediska_Key_List($this->_getKeyName("queue_$queueName"), array('rediska' => $this->_rediska));
        }

        $result = $this->_queueObjects[$queueName]->prepend($message);

        if ($result === false) {
            require_once 'Zend/Queue/Exception.php';
            throw new Zend_Queue_Exception('Failed to insert message into queue:' . $queueName);
        }

        $options = array(
            'queue' => $queue,
            'data'  => array('body' => $message),
        );

        $classname = $queue->getMessageClass();
        if (!class_exists($classname)) {
            require_once 'Zend/Loader.php';
            Zend_Loader::loadClass($classname);
        }
        return new $classname($options);
    }
public function send($message, Zend_Queue $queue=null)
    {
        if ($queue === null) {
            $queue = $this->_queue;
        }

        $queueName = $queue->getName();

        if (!$this->isExists($queueName)) {
            require_once 'Zend/Queue/Exception.php';
            throw new Zend_Queue_Exception('Queue does not exist:' . $queueName);
        }

        if (!isset($this->_queueObjects[$queueName])) {
            $this->_queueObjects[$queueName] = new Rediska_Key_List($this->_getKeyName("queue_$queueName"), array('rediska' => $this->_rediska));
        }

        $result = $this->_queueObjects[$queueName]->prepend($message);

        if ($result === false) {
            require_once 'Zend/Queue/Exception.php';
            throw new Zend_Queue_Exception('Failed to insert message into queue:' . $queueName);
        }

        $options = array(
            'queue' => $queue,
            'data'  => array('body' => $message),
        );

        $classname = $queue->getMessageClass();
        if (!class_exists($classname)) {
            require_once 'Zend/Loader.php';
            Zend_Loader::loadClass($classname);
        }
        return new $classname($options);
    }
public function send ( $ message , Zend_Queue $ queue = null ) { if ( $ queue === null ) { $ queue = $ this -> _queue ; } $ queueName = $ queue -> getName ( ) ; if ( ! $ this -> isExists ( $ queueName ) ) { require_once 'Zend/Queue/Exception.php' ; throw new Zend_Queue_Exception ( 'Queue does not exist:' . $ queueName ) ; } if ( ! isset ( $ this -> _queueObjects [ $ queueName ] ) ) { $ this -> _queueObjects [ $ queueName ] = new Rediska_Key_List ( $ this -> _getKeyName ( "queue_$queueName" ) , array ( 'rediska' => $ this -> _rediska ) ) ; } $ result = $ this -> _queueObjects [ $ queueName ] -> prepend ( $ message ) ; if ( $ result === false ) { require_once 'Zend/Queue/Exception.php' ; throw new Zend_Queue_Exception ( 'Failed to insert message into queue:' . $ queueName ) ; } $ options = array ( 'queue' => $ queue , 'data' => array ( 'body' => $ message ) , ) ; $ classname = $ queue -> getMessageClass ( ) ; if ( ! class_exists ( $ classname ) ) { require_once 'Zend/Loader.php' ; Zend_Loader :: loadClass ( $ classname ) ; } return new $ classname ( $ options ) ; }
Send a message to the queue

@param  string     $message Message to send to the active queue
@param  Zend_Queue $queue
@return Zend_Queue_Message
@throws Zend_Queue_Exception
Send a message to the queue