Skip to content

Queue serialization and persistent storage (in redis)

Marcus Oskarsson requested to merge gh-52b00eee/370/marcus-oscarsson/pmock into master

Created by: marcus-oscarsson

Hey !

Added some missing pieces to the queue serialization to for instance handle helical scans. Also added the routines necessary to load a queue from its serialized format. Which at the moment is a pickled dictionary (the one returned by queue_to_dict). We could use any queue_to method if we consider one representation being better than the other.

A side note, there is now a parameter in the parameters dict of the data collection named 'helical' its perhaps possible to renamed it to experimentType (or similar). This would match the internal model better and also makes it possible to easily add other types of data collection without adding an extra parameter.

Ive also disabled the loading for persistent storage, for the moment, since its causing us some problems with adding things to the queue. Not only because of PMock but also because the queue is loaded on login and not synchronized with the UI. We thus sometimes try to add the same samples twice which produces an error.

The queue is currently saved on logout, the idea is also to save it on any other client disconnect event. And restore it on login if there is no "active" session.

Also note that restoring a queue from persistent storage also depends on the state of the hardware at the time of the save so it might not be as straightforward as just performing a load queue. So I prefer not to load the queue for the time being, until we have defined what to restore when ...

Cheers, Marcus

Merge request reports

Loading