-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
import asyncio
import aiocontext
context = aiocontext.Context()
async def print_request():
print("Request ID:", context.get('request_id', 'unknown'))
async def handle_request():
context['request_id'] = 42
await print_request()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
aiocontext.wrap_task_factory(loop)
context.attach(loop)
loop.run_until_complete(handle_request())
AttributeError: type object '_asyncio.Task' has no attribute 'current_task'
sys:1: RuntimeWarning: coroutine 'handle_request' was never awaited
Python version 3.10
Metadata
Metadata
Assignees
Labels
No labels