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


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

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

        /** @var QueuedPayload $qPayload */
        $qPayload = $qPayload->withQueue( $this->_normalizeQueueName($queue) );


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

        if (! isset($this->queues[$qName]) )
            $this->queues[$qName] = [];

        $ps = &$this->queues[$qName];
        $ps[$uid] = [
            'id'      => $uid,
            'queue'   => $qName,
            'payload' => $qPayload,
            'created_timestamp' => $time,
        ];


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


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

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

        /** @var QueuedPayload $qPayload */
        $qPayload = $qPayload->withQueue( $this->_normalizeQueueName($queue) );


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

        if (! isset($this->queues[$qName]) )
            $this->queues[$qName] = [];

        $ps = &$this->queues[$qName];
        $ps[$uid] = [
            'id'      => $uid,
            'queue'   => $qName,
            'payload' => $qPayload,
            'created_timestamp' => $time,
        ];


        return $qPayload;
    }
Push To Queue

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

@return iPayloadQueued
@throws exIOError