tobymao / saq

Simple Async Queues
https://saq-py.readthedocs.io/en/latest/
MIT License
585 stars 41 forks source link

Context Worker #49

Closed genfild closed 1 year ago

genfild commented 1 year ago

The example uses context change, which doesn't work.

async def startup(ctx):
    ctx["db"] = await create_db()

The following code works ctx['worker'].context["db"] = await create_db()