WIP: Refactor scan watcher
Here is a proposal to refactor the Redis data walker in order to be:
- Strict and explicit
- Expose a clear stable API
- Allow further changes without breaking the API
- Stay compatible with the old API (for few months)
This are needed, cause this API is shared outside Bliss.
What i have changed right now:
- Create a class
DataWatch
which is responsible of the listening (i mostly changed no code, just the exposed structure) - Create explicit (and consistent) methods for events, which have to be overwritten (but we can discuss here, i don't care much, an handler class or what...)
- Create data event using typed namedtuple (to get ride of this dirty dictionaries)
- I did NOT change the code itself, there is still the 2 big original functions (and i don't really want to touch that)
What i will change:
- Create specific methods for
data_acquired
anddata_saved
(MCAs and images) or something close to that. Right now there is no single event to know when a new image was acquired without reaching deep inside Redis, and i don't think anybody on the client side wants to deal with. - Maybe deal with parallel scans (which is buggy AFAIK)
- Maybe deal with scan sequence (which does not exists AFAIK)
For now i just want to be sure my current MR is fine, cause i uses a lot of namedtuples and types, and that's not really the coding style of the bliss code.