When calling the app.run() method in the main function, it blocks the thread as expected. However, when running it in a thread, it doesn't block, which causes the HTTP service to fail. #1817
Replies: 2 comments
-
Your code mentions the |
Beta Was this translation helpful? Give feedback.
-
It doesn't block because there is nothing to run. When you call run in another thread, it will use that thread's loop. But you have registered stuff in the main thread's loop. run() uses thread local Loop. So you are trying to run another loop. You need to register stuff on the same thread that runs the app. Or, simply, you just need to stop using threads, since the library is single-threaded (with exceptions) |
Beta Was this translation helpful? Give feedback.
-
When calling the app.run() method in the main function, it blocks the thread as expected. However, when running it in a thread, it doesn't block, which causes the HTTP service to fail.
Beta Was this translation helpful? Give feedback.
All reactions