cli_proton_python.coreclient module¶
Proton reactive API python core client module
-
exception
cli_proton_python.coreclient.ClientException(message)[source]¶ Bases:
exceptions.Exceptioncustom client exception class (just to know source of exception)
-
class
cli_proton_python.coreclient.CoreClient(opts, reactor_opts=None)[source]¶ Bases:
proton.handlers.MessagingHandlerProton reactive API python core client
implements various support methods for sender, recevier and connector
-
static
calculate_delay(in_count, in_duration)[source]¶ calculates delay between sending/receiving messages used by shecduler when requested by duration option (uses logic from deprecated utils.sleep4next)
Parameters: - in_count (int) – number of messages to be sent/received
- in_duration (int) – send/receive process total execution time
Returns: computed time to wait before or after message is sent/received
Return type: float
-
on_transport_error(event)[source]¶ handler called when any error related to transport occurs
See also
MessagingHandler::on_transport_error
Parameters: event (proton.Event) – reactor event
-
parse_connection_options()[source]¶ Prepare options passed to container connect
Returns: connection options Return type: dict
-
print_message(message)[source]¶ prints or store a message
utils.print_message wrapper
Parameters: - msg (proton.Message) – message
- msg_format (str) – pre-defined message format
-
set_delay_after()[source]¶ returns delay duration after sending a message (in seconds)
Returns: time to wait after message is sent/received Return type: float
-
set_delay_before()[source]¶ returns delay duration before sending a message (in seconds)
Returns: time to wait before message is sent/received Return type: float
-
set_up_ssl_client_auth(event)[source]¶ sets-up SSLDomain for the client authentication
Parameters: event (proton.Event) – reactor event
-
static
-
class
cli_proton_python.coreclient.CustomBackoff(interval=None, limit=None, timeout=None)[source]¶ Bases:
proton.reactor.Backoffa reconnect strategy involving an increasing delay between retries, up to a maximum or 60 seconds. This is a modified version supporting limit to the number of reconnect attempts before giving up.
-
class
cli_proton_python.coreclient.DelayedNoop[source]¶ Bases:
objectcallback object that does nothing.