/** * Sends and delivers a message. * * @param boolean|null $success */ public function sendAndDeliver($success = true) { try { $message = $this->popMessageInternalWorker->pop(); } catch (EmptyQueueInternalException $e) { return; } $this->logDeliveryOperationApiWorker->log($message['message'], $success ? 'Delivered' : 'Not Delivered', time()); }
/** * Sends given amount of messages. * * @param int $amount */ public function send($amount = 100) { for ($i = 0; $i <= $amount; $i++) { try { $message = $this->popMessageInternalWorker->pop(); } catch (EmptyQueueInternalException $e) { return; } $this->sendMessageInternalWorker->send($message['message'], $message['receiver'], $message['body']); } }