Skip to content

Instantly share code, notes, and snippets.

@lempzz
Last active March 14, 2022 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lempzz/117550f28ff0e3316ae81751817de15d to your computer and use it in GitHub Desktop.
Save lempzz/117550f28ff0e3316ae81751817de15d to your computer and use it in GitHub Desktop.
Check if script being executed inside Swoole context
<?php
function is_swoole_context() : bool {
return \Swoole\Coroutine::getCid() !== -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment