tethys.core.transports.transport_base

Module Contents

class tethys.core.transports.transport_base.TransportBase[source]

Bases: tethys.core.regobjs.regobj_base.RegistrableObjectBase

Base abstract class for the Transport

abstract is_connected(self, stream: StreamBase, **kwargs) → bool[source]

Is the connection established

Parameters

stream (StreamBase) – Stream for the connection

Return type

bool

abstract connect(self, stream: StreamBase, **kwargs)[source]

Establish the connection

Parameters

stream (StreamBase) – Stream for the connection

abstract disconnect(self, stream: StreamBase, **kwargs)[source]

Disconnect the stream’s connection

Parameters

stream (StreamBase) – Stream for the connection

abstract recv(self, stream: StreamBase, **kwargs)[source]

Read data_packet from the stream (using the current connection)

Parameters

stream (StreamBase) – Stream for the connection

abstract send(self, stream: StreamBase, data_packet: Any, **kwargs)[source]

Send data_packet to the stream (using connection)

Parameters
  • stream (StreamBase) – Stream for the connection

  • data_packet – any data object

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

Acknowledge message

Parameters
  • stream (StreamBase) – Stream for the connection

  • message_key (str) – message key for the acknowledgement