coinbase-advanced-py
coinbase-advanced-py copied to clipboard
Store asyncio.Task to Avoid GC
I was looking through the websocket code recently and noticed that a Task was being created and not stored anywhere. The async docs call this out as a problem since created Tasks can be garbage-collected if they're not referenced by anything, thus stopping them mid-execution.
I haven't seen this occur, but it's an easy fix to store it on the class, and from a quick reading I don't think it should have any side effects.
Link (second badge labeled "Important"): https://docs.python.org/3/library/asyncio-task.html#creating-tasks
🟡 Heimdall Review Status
| Requirement | Status | More Info | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Reviews |
🟡
0/1
|
Denominator calculation
|