labscript_utils.ls_zprocess¶
-
class
labscript_utils.ls_zprocess.
Context
(io_threads=1, shared_secret=None)[source]¶ Subclass of zprocess.security.SecureContext configured with settings from labconfig, substitutable for a zmq.Context. Can be instantiated to get a unique context, or call the .instance() classmethod to possibly get an already-existing one. Only use the latter if you do not indent to terminate the context.
-
classmethod
instance
()[source]¶ Returns a shared instance with the same shared secret, if there is one, otherwise creates it. If an instance already exists, io_threads will be ignored, otherwise it will be used in the new instance. Takes into account subclasses such that a subclass calling this method will always get back an instance of its own class
-
classmethod
-
class
labscript_utils.ls_zprocess.
ProcessTree
(shared_secret=None, allow_insecure=False, zlock_host=None, zlock_port=7339, zlog_host=None, zlog_port=7340)[source]¶ A singleton zprocess.ProcessTree configured with settings from labconfig for security, zlock and zlog. Being a singleton is not enforced - the class can still be instantiated as normal - but calling the .instance() classmethod will give the singleton.
-
_instance
= <labscript_utils.ls_zprocess.ProcessTree object>¶
-
-
class
labscript_utils.ls_zprocess.
ZMQClient
[source]¶ A singleton zprocess.ZMQClient configured with settings from labconfig for security. Being a singleton is not enforced - the class can still be instantiated as normal - but calling the .instance() classmethod will give the singleton.
-
_instance
= None¶
-
-
class
labscript_utils.ls_zprocess.
ZMQServer
(port=None, dtype='pyobj', pull_only=False, bind_address='tcp://0.0.0.0', timeout_interval=None, **kwargs)[source]¶ A ZMQServer configured with security settings from labconfig
-
labscript_utils.ls_zprocess.
ensure_connected_to_zlog
()[source]¶ Ensure we are connected to a zlog server. If one is not running and we are the top-level process, start a zlog server configured according to LabConfig.