Start a worker to run background tasks for multiple functions
To start a worker to run background tasks for multiple functions, call serve() with the tasks you want to run.
from prefect import taskfrom prefect.task_worker import serve@task(log_prints=True)def add(a: int, b: int): print(f"{a} + {b} = {a + b}")@task(log_prints=True)def multiply(a: int, b: int): print(f"{a} * {b} = {a * b}")# Both these invocations will run once the worker is startedadd.delay(1, 2)multiply.delay(1, 4)serve(add, multiply) # start a task worker listening for both `add` and `multiply`