src/Queue/PdoQueue.php
function push($payload, $queue = null)
    {
        $payload = clone $payload;


        if (null === $queue && $payload instanceof iPayloadQueued)
            $queue = $payload->getQueue();

        try
        {
            $qPayload = $payload;
            if (! $payload instanceof iPayloadQueued ) {
                $qPayload = new QueuedPayload($payload);
                $qPayload = $qPayload
                    ->withUID( \Poirot\Std\generateUniqueIdentifier(24) )
                ;
            }

            $qPayload = $qPayload->withQueue( $this->_normalizeQueueName($queue) );


            ## Persist Queued Payload
            #
            $uid      = $qPayload->getUID();
            $qName    = $qPayload->getQueue();
            $sPayload = addslashes(serialize($qPayload));
            $time     = $qPayload->getCreatedTimestamp();

            $sql = "INSERT INTO `{$this->table}` 
                   (`task_id`, `queue_name`, `payload`, `created_timestamp`, `is_pop`)
                   VALUES ('$uid', '$qName', '$sPayload', '$time', '0');
            ";

            if ( false === $this->conn->exec($sql) )
                throw new \Exception( $this->conn->errorInfo() );


        } catch (\Exception $e) {
            throw new exWriteError($e->getMessage(), $e->getCode(), $e);
        }


        ## Persist Queue Job
        #
        return $qPayload;
    }
function push($payload, $queue = null)
    {
        $payload = clone $payload;


        if (null === $queue && $payload instanceof iPayloadQueued)
            $queue = $payload->getQueue();

        try
        {
            $qPayload = $payload;
            if (! $payload instanceof iPayloadQueued ) {
                $qPayload = new QueuedPayload($payload);
                $qPayload = $qPayload
                    ->withUID( \Poirot\Std\generateUniqueIdentifier(24) )
                ;
            }

            $qPayload = $qPayload->withQueue( $this->_normalizeQueueName($queue) );


            ## Persist Queued Payload
            #
            $uid      = $qPayload->getUID();
            $qName    = $qPayload->getQueue();
            $sPayload = addslashes(serialize($qPayload));
            $time     = $qPayload->getCreatedTimestamp();

            $sql = "INSERT INTO `{$this->table}` 
                   (`task_id`, `queue_name`, `payload`, `created_timestamp`, `is_pop`)
                   VALUES ('$uid', '$qName', '$sPayload', '$time', '0');
            ";

            if ( false === $this->conn->exec($sql) )
                throw new \Exception( $this->conn->errorInfo() );


        } catch (\Exception $e) {
            throw new exWriteError($e->getMessage(), $e->getCode(), $e);
        }


        ## Persist Queue Job
        #
        return $qPayload;
    }
Push To Queue

@param iPayload|iPayloadQueued $payload Serializable payload
@param string   $queue

@return iPayloadQueued
@throws exIOError