6. cc_proxy

6.1. Proxy Channel

module:

cc_proxy

synopsis:

CChannel implementation for multi-auxiliary usage.

CCProxy channel was created, in order to enable the connection of multiple auxiliaries on one and only one CChannel. This CChannel has to be used with a so called proxy auxiliary.

class pykiso.lib.connectors.cc_proxy.CCProxy(**kwargs)[source]

Proxy CChannel to bind multiple auxiliaries to a single ‘physical’ CChannel.

Initialize attributes.

_bind_channel_info(proxy_aux)[source]

Bind a ProxyAuxiliary instance that is instanciated in order to handle the connection of multiple auxiliaries to a single communication channel.

This allows to access the real communication channel’s attributes and hides the underlying proxy setup.

Parameters:

proxy_aux (ProxyAuxiliary) – the proxy auxiliary instance that is holding the real communication channel.

_cc_close()[source]

Close proxy channel.

Return type:

None

_cc_open()[source]

Open proxy channel.

Return type:

None

_cc_receive(timeout=0.1)[source]

Depopulate the queue out of the proxy connector.

Parameters:

timeout (float) – not used

Return type:

Union[Dict[str, Union[bytes, int]], Dict[str, Optional[bytes]], Dict[str, Optional[Message]], Dict[str, None]]

Returns:

bytes and source when it exist. if queue timeout is reached return None

_cc_send(*args, **kwargs)[source]

Call the attached ProxyAuxiliary’s transmission callback with the provided arguments.

Parameters:
  • args (Any) – positionnal arguments to pass to the callback

  • kwargs (Any) – named arguments to pass to the callback

Return type:

None

attach_tx_callback(func)[source]

Attach to a callback to the _cc_send method.

Parameters:

func (Callable) – function to call when _cc_send is called

Return type:

None

close()[source]

Close a thread-safe channel.

Return type:

None

detach_tx_callback()[source]

Detach the current callback.

Return type:

None

open()[source]

Open a thread-safe channel.

Return type:

None