LimaClientInterface requirements and issues
Several issues I noted while developing Lima2 support. LimaClientInterface
is the interface that LimaClient
s needs to implement to integrate into the LimaStream
. Ultimately, this could be generalized to DataAccessor
.
Looking at this NexusWriter code:
elif channel.data_type == types.ChannelDataType.LIMA_STATUS:
try:
lima_client, use_references = self._lima_clients[channel.name]
except KeyError:
lima_client = lima_client_factory(self._data_store, channel.info)
if not lima_client._saved:
return
if not writer.is_internal:
use_references, _ = self._scan_writer._save_reference_mode(
lima_client.file_format
)
else:
use_references = False
if use_references:
lima_client = lima_client_factory(
self._data_store, channel.info, ref_mode=True
)
self._lima_clients[channel.name] = (lima_client, use_references)
last_status = data[-1]
lima_client.update(**last_status) # Only the last status is relevant
self._add_lima_data(writer, lima_client, use_references)
- To gevent or not?
- When used in the context of the external writer (
nexus
), the client needs to be gevent free - When used in the context of the internal writer (
hdf5
), the client needs to be gevent friendly (e.g. pyTango patched)
The LimaClient
already uses is_anything_patched
to switch the DeviceProxy implementation.
The Lima2 Client library uses gevent and needs to be made gevent-free if used in the context of the threaded blissdata-based application.
lima_client._saved
- This is not part of the interface.
- The writer creates a client just to check whether the channel is saved or not. The
LimaClientInterface
requires to be implemented with lazy initialization (we dont want to create nDeviceProxy
s just for this check).
__getitem__
This interface does not allow to specify which acquisition we are referencing. In LimaClientInterface
, what about get_data(frame_id : int | slice, acq_id: int | uuid)
? The __getitem__
(mostly cosmetic no?) could be implemented at a higher level.