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); } }
/** * 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); }