alias_ns.php 561 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * This file is part of Swoole.
  4. *
  5. * @link https://www.swoole.com
  6. * @contact team@swoole.com
  7. * @license https://github.com/swoole/library/blob/master/LICENSE
  8. */
  9. declare(strict_types=1);
  10. namespace Co;
  11. use Swoole\Coroutine;
  12. if (SWOOLE_USE_SHORTNAME) {
  13. function run(callable $fn, ...$args)
  14. {
  15. return \Swoole\Coroutine\run($fn, ...$args);
  16. }
  17. function go(callable $fn, ...$args)
  18. {
  19. return Coroutine::create($fn, ...$args);
  20. }
  21. function defer(callable $fn)
  22. {
  23. Coroutine::defer($fn);
  24. }
  25. }