Last active
March 14, 2022 10:32
-
-
Save lempzz/117550f28ff0e3316ae81751817de15d to your computer and use it in GitHub Desktop.
Check if script being executed inside Swoole context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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