7. cc_raw_loopback

7.1. Loopback CChannel

module

cc_raw_loopback

synopsis

Loopback CChannel for testing purposes.

class pykiso.lib.connectors.cc_raw_loopback.CCLoopback(**kwargs)[source]

Loopback CChannel for testing purposes.

Whatever gets sent via cc_send will land in a FIFO and can be received via cc_receive.

constructor

_cc_close()[source]

Close loopback channel.

Return type

None

_cc_open()[source]

Open loopback channel.

Return type

None

_cc_receive(timeout, raw=True)[source]

Read message by simply removing an element from the left side of deque.

Parameters
  • timeout (float) – timeout applied on receive event

  • raw (bool) – if raw is True return raw bytes, otherwise Message type like

Return type

Union[Message, bytes, str]

Returns

Message or raw bytes if successful, otherwise None

_cc_send(msg, raw=True)[source]

Send a message by simply putting message in deque.

Parameters
  • msg (Union[Message, bytes, str]) – message to send, should be Message type or bytes.

  • raw (bool) – if raw is True simply send it as it is, otherwise apply serialization

Return type

None