tethys.core.streams.stream_base

Module Contents

class tethys.core.streams.stream_base.StreamBase[source]

Bases: tethys.core.regobjs.regobj_base.RegistrableObjectBase

Base abstract class for the Streams

property is_busy(self) → bool[source]

Is some station using the stream?

Return type

bool

abstract open(self, **kwargs) → 'StreamBase'[source]

Open the stream

Returns

self instance

Return type

StreamBase

abstract close(self, **kwargs) → 'StreamBase'[source]

Close the stream

Returns

self instance

Return type

StreamBase

abstract write(self, data_packet: Any, **kwargs)[source]

Write the data_packet to the stream

Parameters

data_packet – any data object

abstract read(self, count: int = None, wait_timeout: float = None, **kwargs) → Generator[source]

Read the data_packets from the stream. Return Generator.

Parameters
  • count (int) – count of the data_packets

  • wait_timeout (float) – waiting time (seconds)

abstract ack(self, message_key: str, **kwargs)[source]

Acknowledge message

Parameters

message_key (str) – message key for the acknowledgement

abstract redirect_to(self, station: StationBase, **kwargs)[source]

Redirect stream processing to the station

Parameters

station (StationBase) – Station where the stream can be processed in the near time

abstract heartbeat(self, **kwargs)[source]

Health heartbeat