TaskEventListener.php 809 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. //
  3. //declare(strict_types=1);
  4. //
  5. //namespace App\Listener;
  6. //
  7. //use Hyperf\Event\Annotation\Listener;
  8. //use Hyperf\Event\Contract\ListenerInterface;
  9. //use Hyperf\Framework\Event\BeforeMainServerStart;
  10. //use Hyperf\Task\TaskExecutor;
  11. //use Psr\Container\ContainerInterface;
  12. //
  13. //#[Listener]
  14. //class TaskEventListener implements ListenerInterface
  15. //{
  16. // public function __construct(private ContainerInterface $container)
  17. // {
  18. // }
  19. //
  20. // public function listen(): array
  21. // {
  22. // return [
  23. // BeforeMainServerStart::class,
  24. // ];
  25. // }
  26. //
  27. // public function process(object $event): void
  28. // {
  29. // $executor = $this->container->get(TaskExecutor::class);
  30. // $event->server->on('Task', [$executor, 'execute']);
  31. // }
  32. //}