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
Can background tasks set timed tasks? Just like crontab time expression #2233
Comments
The feature is mainly just a thin wrapper around |
Ok, I see async def generate_code(app):
await asyncio.sleep(1)
print('Server successfully started!')
app.add_task(generate_code(app)) |
Or can it only be done through Python's own loop? E.g: async def generate_code(app):
while True:
await asyncio.sleep(5)
print('Server successfully started!')
app.add_task(generate_code(app)) |
@jakehu the |
This is what I would do 💪 |
If we are to implement it in Sanic, this could be a good starting point: https://github.com/Rapptz/discord.py/blob/master/discord/ext/tasks/__init__.py Documentation at https://discordpy.readthedocs.io/en/stable/ext/tasks/index.html |
This is really a good idea |
It feels more like something we should add to |
Honestly, it is partially something I have been kicking around in my head for a long time as its own full blown project. But, there is probably a simpler implementation we could achieve first. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions. |
... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions. |
Can background tasks set timed tasks? Just like crontab time expression
The text was updated successfully, but these errors were encountered: