rcrowe\Hippy\Client::send PHP Méthode

send() public méthode

Send a single message or a queue of messages. A queue must implement \Iterator in order to work.
public send ( rcrowe\Hippy\Message\SenderInterface $msg ) : void
$msg rcrowe\Hippy\Message\SenderInterface
Résultat void
    public function send(SenderInterface $msg)
    {
        // $messages = (!$msg->isQueue()) ? array($msg) : $msg;
        $messages = !is_a($msg, 'Iterator') ? array($msg) : $msg;
        foreach ($messages as $message) {
            $this->transport->send($message);
        }
    }

Usage Example

Exemple #1
0
 /**
  * Send all messages in the queue.
  *
  * @throws RuntimeException When Facade::init() has not been called.
  * @return void
  */
 public static function go()
 {
     if (static::$client === null) {
         throw new RuntimeException('Must call init first');
     }
     static::$client->send(static::$queue);
 }
All Usage Examples Of rcrowe\Hippy\Client::send