mirror of
https://github.com/elyby/accounts.git
synced 2024-11-16 10:14:02 +05:30
17 lines
417 B
PHP
17 lines
417 B
PHP
<?php
|
|
namespace common\components\RabbitMQ;
|
|
|
|
use PhpAmqpLib\Message\AMQPMessage;
|
|
|
|
trait MessageTrait {
|
|
|
|
public function ack(AMQPMessage $msg) {
|
|
$msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);
|
|
}
|
|
|
|
public function reject(AMQPMessage $msg, $requeue = true) {
|
|
$msg->delivery_info['channel']->basic_reject($msg->delivery_info['delivery_tag'], $requeue);
|
|
}
|
|
|
|
}
|