Finish Asyncio Port of BLED112 Transport Plugin
- Dominant language
- Python
- Stars
- 14
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
> **Note** This is still a draft epic that has not yet been prioritized or staffed.
We never finished the port of the BLED112 device adapter over to asyncio. There are a few nuanced to doing the port that need to be thought through though.
1. `pyserial` does not fully support asyncio on all platforms so we can't just ditch the `ReaderThread` and move to a fully asyncio based solution on Windows at least. See the alternative implementation for how to improve the status quo without needing that.
2. Moving to asyncio properly will require refactoring how `BLED112CommandProcessor` handles long-running operations. Right now it uses a hybrid blocking wait with event dispatch while waiting system that is problematic but means moving to a proper asyncio system will need to rework the way commands are sent.
3. Making sure we retain the current implementation robustness will mean porting over the new implementation to use `OperationManager` to handle the parallelism of having different coroutines waiting on different ble operations. For example, there could be 3 simultaneous connections in progress each one blocking on a read or a write or a connect operation. We need to make sure that each connection gets its events properly without blocking other connections.
The final result should be that we have a fully asyncio-based bled112 device adapter that should be more performant as well as easier to reason about. Once we have that, we can work on generalizing the coroutine based `ble` interface to support other kinds of ble controller hardware.
Contributor guide
Assessment
This issue has not been assessed yet.