Using pydase 0.10.1, defining as task with the @task decorator without autostart (@task() or @task(autostart=False)) leads to failure to start server.
To Reproduce
import asyncio
import pydase
from pydase.task.decorator import task
class MyService(pydase.DataService):
@task(autostart=False)
async def my_task(self) -> None:
while True:
# Perform some periodic work
await asyncio.sleep(1)
if __name__ == "__main__":
service = MyService()
pydase.Server(service=service).run()
Expected behaviour
Should generate frontend element to start/stop task.
Screenshot/Video
Additional context
Defining the task with autostart (@task(autostart=True)) starts the server successfully, generates the start/stop elements, and starts the task.
Describe the bug
Using pydase 0.10.1, defining as task with the
@task
decorator without autostart (@task()
or@task(autostart=False)
) leads to failure to start server.To Reproduce
Expected behaviour
Should generate frontend element to start/stop task.
Screenshot/Video
Additional context
Defining the task with autostart (
@task(autostart=True)
) starts the server successfully, generates the start/stop elements, and starts the task.