mirror of
https://github.com/xcat2/confluent.git
synced 2026-02-19 22:24:26 +00:00
Make it easier to debug slow callback
Provide a name to create_task to make the slow callback warning actually usable.
This commit is contained in:
@@ -64,9 +64,9 @@ def spawn(coro):
|
||||
tskid = random.random()
|
||||
tsks[tskid] = 1
|
||||
try:
|
||||
tsks[tskid] = asyncio.create_task(_run(coro, tskid))
|
||||
tsks[tskid] = asyncio.create_task(_run(coro, tskid), name=repr(coro))
|
||||
except AttributeError:
|
||||
tsks[tskid] = asyncio.get_event_loop().create_task(_run(coro, tskid))
|
||||
tsks[tskid] = asyncio.get_event_loop().create_task(_run(coro, tskid), name=repr(coro))
|
||||
return tsks[tskid]
|
||||
|
||||
async def _run(coro, taskid):
|
||||
|
||||
Reference in New Issue
Block a user