alengwenus / pypck

Asynchronous LCN-PCK library written in Python
MIT License
8 stars 4 forks source link

Add a task registry for proper cancelling of all pending tasks #73

Closed alengwenus closed 3 years ago

alengwenus commented 3 years ago

Pypck relies heavily on Python's asyncio module. To properly close all pending tasks when connection is closed, one has to keep track of all pypck tasks which are scheduled on the event loop. This PR implements a task registry with a designated create_task function which should be used instead of asyncio.create_task.