Rework watch_session_scans as a class
In order to optimize the data watcher in Flint i want to receive new data from this class and not the full data.
This MR refactor watch_session_scans
to implement it as a class, which allow more flexibility to setup an a clear documented API.
For changes:
- There is now a
ScansWatcher
to handle the process - An abstract
ScansObserver
to take care of the client side callback API- Scans are identified as there unique name, always, in the callbacks:
scan_db_name
- channel_name
- Only the new data is transmitted
- A split of the data callbacks which make it much easier to handle in client side
on_scalar_data_received
on_ndim_data_received
on_lima_ref_received
- Scans are identified as there unique name, always, in the callbacks:
-
DefaultScansObserver
is an adapter to provide the same features as before (concatenating data, storing running scans)- It is now storing cache, which is used to compute single time stuffs
- Side effect: the even processing should be faster when there is a lot of channels
-
watch_session_scans
provides the exact same features as before usingDefaultScansObserver
Extra
- I would prefer to merge
on_scalar_data_received
andon_ndim_data_received
to me it's the exact same API. a channel with it's data.
Next
If the API is fine for you, i can try to remove the use ofwatch_session_scans
inside BLISS.- As proposed by Wout, we could remove the old events and use the new once.
- I suggest to handle Lima ref as a specific event one day, to make the walking event cleaner. There should no need of complex check to know that this kind have to be handle in a totally different way than a normal
NEW_DATA
.
For now i am fine with the current state, and i can play with it in Flint.