mirror of
https://github.com/elyby/accounts.git
synced 2024-11-15 17:56:30 +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);
|
||
|
}
|
||
|
|
||
|
}
|