1234567891011121314151617181920212223 |
- <?php
- namespace ln\listens;
- use ln\interfaces\ListenerInterface;
- use Swoole\Process;
- use Swoole\Server;
- class CreateTimerListen implements ListenerInterface
- {
- public function handle($event): void
- {
- $process = new Process(function () {
- app()->event->trigger('create_timer');
- }, false, 0, true);
- app()->make(Server::class)->addProcess($process);
- }
- }
|