getQueueDispatcher()->linkTaskToQueue(WebhookTask::class, $queueName); } /** * Create and enqueue task for performing webhook * @param WebhookTaskParams $webhookTaskParams */ public function createTask(WebhookTaskParams $webhookTaskParams) { $task = new WebhookTask(); $this->propagate($task); /** @var QueueDispatcherInterface $queueDispatcher */ $this->getQueueDispatcher()->createTask($task, (array) $webhookTaskParams, 'Event Webhook'); } /** * @return QueueDispatcherInterface */ private function getQueueDispatcher() { /** @noinspection PhpIncompatibleReturnTypeInspection */ return $this->getServiceLocator()->get(QueueDispatcherInterface::SERVICE_ID); } }