Вот такой кусок кода.
Код: Выделить всё
$tag = $answer->getText();
$this->ask('Please describe the channel', function (Answer $answer) use ($tag) {
$data = ['tag' => $tag, 'token' => $this->bot->getUser()->getId(), 'text' => $answer->getText()];
Yii::$app->queue->push(new CreateChannel(['data' => $data]));
Yii::$app->queue->on(\yii\queue\redis\Queue::EVENT_AFTER_EXEC, function ($event) {
echo 'asasdasdasd';
//$conversation->say('The channel was created');
});
$this->say('The channel is sent to the creation queue and will be created soon');
});
Подскажите, пожалуйста, как можно решить данную проблему, то есть, как можно повесить на событие свой обработчик?