新增通用的虚拟数据模型;新增定时任务多进程;新增多进程阻塞模式的定时器;

This commit is contained in:
augushong
2024-10-04 23:03:18 +08:00
parent ee80d6eee5
commit e53445e41c
6 changed files with 198 additions and 22 deletions

View File

@@ -9,10 +9,25 @@ class TimerControllerBase extends ToolsController
{
protected $frequency = null;
protected $concurrency = 1;
protected $concurrencyId = 0;
public function initialize()
{
parent::initialize();
$concurrency_id = $this->request->param('concurrency_id', 0);
if ($concurrency_id > $this->concurrency) {
$this->error('concurrency id error');
}
$this->concurrencyId = $concurrency_id;
$concurrency_count = $this->request->param('concurrency_count', 1);
if ($concurrency_count > $this->concurrency) {
$this->error('concurrency count error');
}
if (is_int($this->frequency)) {
$this->protectVisit($this->frequency);
}