tethys.core.sessions.sess_zero

Module Contents

tethys.core.sessions.sess_zero.log[source]
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

SOFT_CLOSING_MODE = <soft>[source]
HARD_CLOSING_MODE = <hard>[source]
INSTANT_CLOSING_MODE = <instant>[source]
CLASS_PATH = /sessions/[source]

ZeroSession instances collection path in the repository

FIELDS_SCHEMA[source]

ZeroSession fields validators

__setattr__(self, key, value)[source]

Implement setattr(self, name, value).

add_child(self, child: ZeroSession)[source]
remove_child(self, child: ZeroSession)[source]
get_children_dict(self)[source]
open(self, **kwargs) → 'ZeroSession'[source]

This method changes the ZeroSession station to closed=False.

Returns

self object

Return type

ZeroSession

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

ZeroSession

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

__enter__(self) → 'ZeroSession'[source]
__exit__(self, exc_type, exc_val, exc_tb)[source]