src/Queue/AggregateQueue.php
function push($payload, $queue = null)
    {
        if ($queue === null)
        {
            ## Push To Channels With Max Priority Weight
            #
            $weights = $this->channels_weight;
            while (! empty($weights) )
            {
                $channel = \Poirot\Queue\mathAlias($weights);
                unset($weights[$channel]);

                /** @var iQueueDriver $queue */
                $queue  = $this->channels_queue[$channel];
                if ( $payload = $queue->push($payload, $channel) )
                    break;
            }

        } else {
            if (false === $qd = $this->_getQueueOfChannel($queue) )
                throw new \RuntimeException(sprintf(
                    'Channel (%s) is not present when trying to push payload: (%s).'
                    , $queue, \Poirot\Std\flatten($payload)
                ));


            $payload = $qd->push($payload, $queue);
        }

        return $payload;
    }
function push($payload, $queue = null)
    {
        if ($queue === null)
        {
            ## Push To Channels With Max Priority Weight
            #
            $weights = $this->channels_weight;
            while (! empty($weights) )
            {
                $channel = \Poirot\Queue\mathAlias($weights);
                unset($weights[$channel]);

                /** @var iQueueDriver $queue */
                $queue  = $this->channels_queue[$channel];
                if ( $payload = $queue->push($payload, $channel) )
                    break;
            }

        } else {
            if (false === $qd = $this->_getQueueOfChannel($queue) )
                throw new \RuntimeException(sprintf(
                    'Channel (%s) is not present when trying to push payload: (%s).'
                    , $queue, \Poirot\Std\flatten($payload)
                ));


            $payload = $qd->push($payload, $queue);
        }

        return $payload;
    }
Push To Queue

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

@return iPayloadQueued
@throws exIOError