src/Provider/IronMqProvider.php
public function publishMessages(array $messages, array $options = [])
    {
        $options      = $this->mergeOptions($options);
        $publishStart = microtime(true);

        if (!$this->queueExists()) {
            $this->create();
        }

        $encodedMessages = [];
        foreach ($messages as $message) {
            $encodedMessages[] = json_encode($message + ['_qpush_queue' => $this->name]);
        }

        $result = $this->ironmq->postMessages(
            $this->getNameWithPrefix(),
            $encodedMessages,
            [
                'timeout'       => $options['message_timeout'],
                'delay'         => $options['message_delay'],
                'expires_in'    => $options['message_expiration']
            ]
        );

        $context = [
            'message_ids'    => $result->ids,
            'publish_time'  => microtime(true) - $publishStart
        ];
        $this->log(200, "Messages have been published.", $context);

        return $result->ids;
    }
public function publishMessages(array $messages, array $options = [])
    {
        $options      = $this->mergeOptions($options);
        $publishStart = microtime(true);

        if (!$this->queueExists()) {
            $this->create();
        }

        $encodedMessages = [];
        foreach ($messages as $message) {
            $encodedMessages[] = json_encode($message + ['_qpush_queue' => $this->name]);
        }

        $result = $this->ironmq->postMessages(
            $this->getNameWithPrefix(),
            $encodedMessages,
            [
                'timeout'       => $options['message_timeout'],
                'delay'         => $options['message_delay'],
                'expires_in'    => $options['message_expiration']
            ]
        );

        $context = [
            'message_ids'    => $result->ids,
            'publish_time'  => microtime(true) - $publishStart
        ];
        $this->log(200, "Messages have been published.", $context);

        return $result->ids;
    }
public function publishMessages ( array $ messages , array $ options = [ ] ) { $ options = $ this -> mergeOptions ( $ options ) ; $ publishStart = microtime ( true ) ; if ( ! $ this -> queueExists ( ) ) { $ this -> create ( ) ; } $ encodedMessages = [ ] ; foreach ( $ messages as $ message ) { $ encodedMessages [ ] = json_encode ( $ message + [ '_qpush_queue' => $ this -> name ] ) ; } $ result = $ this -> ironmq -> postMessages ( $ this -> getNameWithPrefix ( ) , $ encodedMessages , [ 'timeout' => $ options [ 'message_timeout' ] , 'delay' => $ options [ 'message_delay' ] , 'expires_in' => $ options [ 'message_expiration' ] ] ) ; $ context = [ 'message_ids' => $ result -> ids , 'publish_time' => microtime ( true ) - $ publishStart ] ; $ this -> log ( 200 , "Messages have been published." , $ context ) ; return $ result -> ids ; }
Publishes multiple message at once

@param array $messages
@param array $options

@return array
Publishes multiple message at once