So I have a structure at the moment that looks like this
import curio
class Base:
async def loop(self):
pass
async def run(self):
while True:
await self.loop()
class Something(Base):
async def loop(self):
await curio.sleep(1)
print("looping in %s" % await curio.current_task())
s = Something()
curio.run(s.run())
Now because it was Base.run that was scheduled as a task in run it will report Base.run every time. This is less helpful when debugging in the monitor as it shows and I don't know which of those Bases is which task.
Is there a way that I could hint to curio what to name a task, or provide some attribute or API for renaming a task to something useful after scheduling.
So I have a structure at the moment that looks like this
Now because it was Base.run that was scheduled as a task in
run
it will reportBase.run
every time. This is less helpful when debugging in the monitor as it shows and I don't know which of those Bases is which task.Is there a way that I could hint to curio what to name a task, or provide some attribute or API for renaming a task to something useful after scheduling.