carno-php /
nsq
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Type message commands |
||
| 4 | * User: moyo |
||
| 5 | * Date: 02/03/2018 |
||
| 6 | * Time: 2:40 PM |
||
| 7 | */ |
||
| 8 | |||
| 9 | namespace Carno\NSQ\Chips; |
||
| 10 | |||
| 11 | use Carno\NSQ\Connector\Nsqd; |
||
| 12 | |||
| 13 | trait TMCommands |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var Nsqd |
||
| 17 | */ |
||
| 18 | private $link = null; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param Nsqd $nsqd |
||
| 22 | * @return static |
||
| 23 | */ |
||
| 24 | public function link(Nsqd $nsqd) : self |
||
| 25 | { |
||
| 26 | $this->link = $nsqd; |
||
| 27 | return $this; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | */ |
||
| 32 | public function done() : void |
||
| 33 | { |
||
| 34 | $this->link->fin($this->id()); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * delayed in milliseconds |
||
| 39 | * @param int $delayed |
||
| 40 | */ |
||
| 41 | public function retry(int $delayed = 0) : void |
||
| 42 | { |
||
| 43 | $this->link->req($this->id(), $delayed); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |