2020-04-29 15:29:56 +08:00
|
|
|
<?php
|
|
|
|
|
|
2022-03-15 18:05:33 +08:00
|
|
|
declare(strict_types=1);
|
2020-04-29 15:29:56 +08:00
|
|
|
|
|
|
|
|
namespace ZM\Annotation\Swoole;
|
|
|
|
|
|
2022-03-20 01:53:36 +08:00
|
|
|
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
|
2020-04-29 15:29:56 +08:00
|
|
|
use Doctrine\Common\Annotations\Annotation\Required;
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\Target;
|
|
|
|
|
use ZM\Annotation\AnnotationBase;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class OnTick
|
|
|
|
|
* @Annotation
|
2022-03-20 01:53:36 +08:00
|
|
|
* @NamedArgumentConstructor()
|
2020-04-29 15:29:56 +08:00
|
|
|
* @Target("METHOD")
|
|
|
|
|
* @since 1.2
|
|
|
|
|
*/
|
|
|
|
|
class OnTick extends AnnotationBase
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var int
|
|
|
|
|
* @Required()
|
|
|
|
|
*/
|
|
|
|
|
public $tick_ms;
|
2020-09-29 15:07:43 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var int
|
|
|
|
|
*/
|
|
|
|
|
public $worker_id = 0;
|
2022-03-20 01:53:36 +08:00
|
|
|
|
|
|
|
|
public function __construct($tick_ms, $worker_id = 0)
|
|
|
|
|
{
|
|
|
|
|
$this->tick_ms = $tick_ms;
|
|
|
|
|
$this->worker_id = $worker_id;
|
|
|
|
|
}
|
2020-04-29 15:29:56 +08:00
|
|
|
}
|