You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@bcremer Already answered via the referenced Twitter thread, but thanks for asking here anyway!
This has been discussed in #20, #44 and others before and this is more or less by design.
As a rule of thumb, mixing blocking and non-blocking code should be avoided. This means these functions should only be used in a blocking application. If you're using a non-blocking application, you should use non-blocking primitives provided by promises and event emitters.
In your case this means that $loop->addTimer() should be used instead of a blocking sleep().
Activity
bcremer commentedon Jul 27, 2020
Closing this issue as per https://twitter.com/giveupalready/status/1287748428861186049.
clue commentedon Aug 1, 2020
@bcremer Already answered via the referenced Twitter thread, but thanks for asking here anyway!
This has been discussed in #20, #44 and others before and this is more or less by design.
As a rule of thumb, mixing blocking and non-blocking code should be avoided. This means these functions should only be used in a blocking application. If you're using a non-blocking application, you should use non-blocking primitives provided by promises and event emitters.
In your case this means that
$loop->addTimer()should be used instead of a blockingsleep().I hope this helps 👍