后台游戏对局实时显示-优化
This commit is contained in:
20
app/process/GameLiveTicker.php
Normal file
20
app/process/GameLiveTicker.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace app\process;
|
||||
|
||||
use app\common\service\GameLiveService;
|
||||
use Workerman\Timer;
|
||||
|
||||
/**
|
||||
* 实时对局:按单局时长自动开奖
|
||||
*/
|
||||
class GameLiveTicker
|
||||
{
|
||||
public function onWorkerStart(): void
|
||||
{
|
||||
Timer::add(1, static function (): void {
|
||||
GameLiveService::tickAutoDraw();
|
||||
GameLiveService::publishSnapshot(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user