alengwenus / pypck

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

Convert the global PYPCK_TASKS to a connection local TaskRegistry #81

Closed maximilianriemensberger closed 3 years ago

maximilianriemensberger commented 3 years ago

The global PYPCK_TASKS functionality is factored out into TaskRegistry class. Each PchkConnection gets it's own separate registry. This registry is used for creating all tasks in connection, module, and request_handler modules. So it's now possible to have multiple distinct PchkConnection objects in the same task.

First draft of what the local TaskRegistry could look like. Tests for multiple connections in on process are still TODO.

@alengwenus Please let me know what think about the approach.

maximilianriemensberger commented 3 years ago

@alengwenus I addressed you comments and added a simple test. Please take a look. Thanks.