berconpy.AsyncCommander

class berconpy.AsyncCommander(*, command_attempts=3, command_interval=1.0)

Bases: object

Handles sending commands and waiting for responses.

Methods

cancel_command(sequence)

Cancels a command in the protocol along with its associated future.

reset()

rtype:

None

send_command(command)

rtype:

str

set_command(sequence, message)

Notifies the future waiting on a command response packet.

wait_for_command(sequence)

Returns a future waiting for a command response with the given sequence number.

Attributes

io_layer

proto_layer

cancel_command(sequence)

Cancels a command in the protocol along with its associated future.

If the command sequence was not queued before, this is a no-op.

Return type:

None

set_command(sequence, message)

Notifies the future waiting on a command response packet.

An alternative message may be given if the packet itself does not contain the full message (i.e. multipart packet).

If no future was created for the packet, this is a no-op.

Return type:

None

wait_for_command(sequence)

Returns a future waiting for a command response with the given sequence number.

Return type:

Future[str]