-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a background task in event loop #154
Comments
I will take this in consideration so in the native extension version we can have this feature added |
+1, is there any workaround to get a periodic task to fire? |
You can register it in the default loop in asyncio using pure python for now |
I tried a few ways to get it to register, but I keep getting errors and I think I'm not handling the registration properly. I keep seeing errors like "Cannot run the event loop while another loop is running." Could you maybe help me with a simple example? How could I add the bg_task to the loop below? Thanks - a bit new to asyncio loops and want to make sure to get this right without degrading the performance of socketify (which is incredible btw)
|
Not sure if this is what you wanted to achieve. If it helps, I have this socketify GPT that helps me a lot! https://chat.openai.com/g/g-ZSUkRkncp-socketify-doc-assistant
|
Is your feature request related to a problem? Please describe.
I would create a background task to do some timerized operation i.e. periodical send some data update to all clients connected
Describe the solution you'd like
something like app.create_background_task(callback)
The text was updated successfully, but these errors were encountered: