|
|
|
|
|
by Miksus
1371 days ago
|
|
Sorry, I'm in quite a hurry (so sorry for the language and lack of ellaboration). You can create tasks dynamically and you can create them after starting the scheduler. You can use app.session.create_task and pass "func" (Python function) for it or path and func_name if you wish to lazily load the task function (imported only when executing the task). You can also pass a command for this method as well. And you can create a task that runs on startup (on_startup=True) and create your other tasks using this task. Use main, async or thread as execution. Then you can create other metatasks that create/modify/delete the tasks on runtime with any logic you want. For example, sync them with a database. I'm planning on doing a proper demo about this at some point. |
|