tethys.core.sessions.sess_zero
¶
Module Contents¶
-
class
tethys.core.sessions.sess_zero.
ZeroSession
(network: Union['ZeroNetwork', str], parent: ZeroSession = None, **kwargs)[source]¶ Bases:
tethys.core.regobjs.regobj_zero.ZeroRegistrableObject
,tethys.core.sessions.sess_base.SessionBase
The Session entity class of the Zero generation. The ZeroSession is a context for the streams.
- Parameters
network (ZeroNetwork) – The network used to run streams in the session scope.
parent (ZeroSession) – The parent session
-
CLASS_PATH
= /sessions/[source]¶ ZeroSession
instances collection path in the repository
-
FIELDS_SCHEMA
[source]¶ ZeroSession
fields validators
-
open
(self, **kwargs) → 'ZeroSession'[source]¶ This method changes the ZeroSession station to closed=False.
- Returns
self object
- Return type
-
close
(self, mode: str = None) → 'ZeroSession'[source]¶ This method changes the ZeroSession station to closing_mode=mode. All children also will be closed.
- Parameters
mode (str) – closing mode determines the mode of closing streams (default: INSTANT_CLOSING_MODE)
- Returns
self object
- Return type
-
send
(self, data_packet: Any, many: bool = False, **kwargs)[source]¶ This method sends data_packet(s) to the input nodes.
- Parameters
data_packet – any data object or list of the data objects (with many=True)
many (bool) – if many=True then data_packet’s elements will be sent one-by-one.
-
refresh
(self, **kwargs) → Union['ZeroSession', None][source]¶ Reload entity from the repository (without cache). Also this method updates streams and sessions states according to the closing mode.
- Returns
return ZeroSession instance or None (when error like NotFound)
- Return type
ZeroSession or None