Repository navigation
How to use Timer::tick ?
#53
Unanswered
foremtehan
asked this question in
Q&A
Replies: 3 comments
|
You can't launch an event loop (timer) before starting the server. You need to start the timer after the server worker is running by listening Also, most of the time you shouldn't call Swoole's functions directly. Instead, use a wrapped timer provided by Hyperf framework |
0 replies
|
@albertcht Ok but another problem is that, there are 8 workers, each of them run the timer, Couldn't we just run one timer in all workers? |
0 replies
|
Nevermind the event i used is MainWorkerStart |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Check List
Content
How and where should we use \Swoole\Timer ?
When i use it in ServiceProvider:
I'll get the following error when i ran:
php artisan serve:All reactions