OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, listeners) |
def | enabled_for_commands (self) |
def | enabled_for_server (self) |
def | enabled_for_server_heartbeat (self) |
def | enabled_for_topology (self) |
def | enabled_for_cmap (self) |
def | event_listeners (self) |
def | publish_command_start (self, command, database_name, request_id, connection_id, op_id=None) |
def | publish_command_success (self, duration, reply, command_name, request_id, connection_id, op_id=None) |
def | publish_command_failure (self, duration, failure, command_name, request_id, connection_id, op_id=None) |
def | publish_server_heartbeat_started (self, connection_id) |
def | publish_server_heartbeat_succeeded (self, connection_id, duration, reply, awaited) |
def | publish_server_heartbeat_failed (self, connection_id, duration, reply, awaited) |
def | publish_server_opened (self, server_address, topology_id) |
def | publish_server_closed (self, server_address, topology_id) |
def | publish_server_description_changed (self, previous_description, new_description, server_address, topology_id) |
def | publish_topology_opened (self, topology_id) |
def | publish_topology_closed (self, topology_id) |
def | publish_topology_description_changed (self, previous_description, new_description, topology_id) |
def | publish_pool_created (self, address, options) |
def | publish_pool_cleared (self, address) |
def | publish_pool_closed (self, address) |
def | publish_connection_created (self, address, connection_id) |
def | publish_connection_ready (self, address, connection_id) |
def | publish_connection_closed (self, address, connection_id, reason) |
def | publish_connection_check_out_started (self, address) |
def | publish_connection_check_out_failed (self, address, reason) |
def | publish_connection_checked_out (self, address, connection_id) |
def | publish_connection_checked_in (self, address, connection_id) |
Configure event listeners for a client instance. Any event listeners registered globally are included by default. :Parameters: - `listeners`: A list of event listeners.
def __init__ | ( | self, | |
listeners | |||
) |
def enabled_for_cmap | ( | self | ) |
Are any ConnectionPoolListener instances registered?
def enabled_for_commands | ( | self | ) |
Are any CommandListener instances registered?
def enabled_for_server | ( | self | ) |
Are any ServerListener instances registered?
def enabled_for_server_heartbeat | ( | self | ) |
Are any ServerHeartbeatListener instances registered?
def enabled_for_topology | ( | self | ) |
Are any TopologyListener instances registered?
def event_listeners | ( | self | ) |
List of registered event listeners.
def publish_command_failure | ( | self, | |
duration, | |||
failure, | |||
command_name, | |||
request_id, | |||
connection_id, | |||
op_id = None |
|||
) |
Publish a CommandFailedEvent to all command listeners. :Parameters: - `duration`: The command duration as a datetime.timedelta. - `failure`: The server reply document or failure description document. - `command_name`: The command name. - `request_id`: The request id for this operation. - `connection_id`: The address (host, port) of the server this command was sent to. - `op_id`: The (optional) operation id for this operation.
def publish_command_start | ( | self, | |
command, | |||
database_name, | |||
request_id, | |||
connection_id, | |||
op_id = None |
|||
) |
Publish a CommandStartedEvent to all command listeners. :Parameters: - `command`: The command document. - `database_name`: The name of the database this command was run against. - `request_id`: The request id for this operation. - `connection_id`: The address (host, port) of the server this command was sent to. - `op_id`: The (optional) operation id for this operation.
def publish_command_success | ( | self, | |
duration, | |||
reply, | |||
command_name, | |||
request_id, | |||
connection_id, | |||
op_id = None |
|||
) |
Publish a CommandSucceededEvent to all command listeners. :Parameters: - `duration`: The command duration as a datetime.timedelta. - `reply`: The server reply document. - `command_name`: The command name. - `request_id`: The request id for this operation. - `connection_id`: The address (host, port) of the server this command was sent to. - `op_id`: The (optional) operation id for this operation.
def publish_connection_check_out_failed | ( | self, | |
address, | |||
reason | |||
) |
Publish a :class:`ConnectionCheckOutFailedEvent` to all connection listeners.
def publish_connection_check_out_started | ( | self, | |
address | |||
) |
Publish a :class:`ConnectionCheckOutStartedEvent` to all connection listeners.
def publish_connection_checked_in | ( | self, | |
address, | |||
connection_id | |||
) |
Publish a :class:`ConnectionCheckedInEvent` to all connection listeners.
def publish_connection_checked_out | ( | self, | |
address, | |||
connection_id | |||
) |
Publish a :class:`ConnectionCheckedOutEvent` to all connection listeners.
def publish_connection_closed | ( | self, | |
address, | |||
connection_id, | |||
reason | |||
) |
Publish a :class:`ConnectionClosedEvent` to all connection listeners.
def publish_connection_created | ( | self, | |
address, | |||
connection_id | |||
) |
Publish a :class:`ConnectionCreatedEvent` to all connection listeners.
def publish_connection_ready | ( | self, | |
address, | |||
connection_id | |||
) |
Publish a :class:`ConnectionReadyEvent` to all connection listeners.
def publish_pool_cleared | ( | self, | |
address | |||
) |
Publish a :class:`PoolClearedEvent` to all pool listeners.
def publish_pool_closed | ( | self, | |
address | |||
) |
Publish a :class:`PoolClosedEvent` to all pool listeners.
def publish_pool_created | ( | self, | |
address, | |||
options | |||
) |
Publish a :class:`PoolCreatedEvent` to all pool listeners.
def publish_server_closed | ( | self, | |
server_address, | |||
topology_id | |||
) |
Publish a ServerClosedEvent to all server listeners. :Parameters: - `server_address`: The address (host, port) pair of the server. - `topology_id`: A unique identifier for the topology this server is a part of.
def publish_server_description_changed | ( | self, | |
previous_description, | |||
new_description, | |||
server_address, | |||
topology_id | |||
) |
Publish a ServerDescriptionChangedEvent to all server listeners. :Parameters: - `previous_description`: The previous server description. - `server_address`: The address (host, port) pair of the server. - `new_description`: The new server description. - `topology_id`: A unique identifier for the topology this server is a part of.
def publish_server_heartbeat_failed | ( | self, | |
connection_id, | |||
duration, | |||
reply, | |||
awaited | |||
) |
Publish a ServerHeartbeatFailedEvent to all server heartbeat listeners. :Parameters: - `connection_id`: The address (host, port) pair of the connection. - `duration`: The execution time of the event in the highest possible resolution for the platform. - `reply`: The command reply. - `awaited`: True if the response was awaited.
def publish_server_heartbeat_started | ( | self, | |
connection_id | |||
) |
Publish a ServerHeartbeatStartedEvent to all server heartbeat listeners. :Parameters: - `connection_id`: The address (host, port) pair of the connection.
def publish_server_heartbeat_succeeded | ( | self, | |
connection_id, | |||
duration, | |||
reply, | |||
awaited | |||
) |
Publish a ServerHeartbeatSucceededEvent to all server heartbeat listeners. :Parameters: - `connection_id`: The address (host, port) pair of the connection. - `duration`: The execution time of the event in the highest possible resolution for the platform. - `reply`: The command reply. - `awaited`: True if the response was awaited.
def publish_server_opened | ( | self, | |
server_address, | |||
topology_id | |||
) |
Publish a ServerOpeningEvent to all server listeners. :Parameters: - `server_address`: The address (host, port) pair of the server. - `topology_id`: A unique identifier for the topology this server is a part of.
def publish_topology_closed | ( | self, | |
topology_id | |||
) |
Publish a TopologyClosedEvent to all topology listeners. :Parameters: - `topology_id`: A unique identifier for the topology this server is a part of.
def publish_topology_description_changed | ( | self, | |
previous_description, | |||
new_description, | |||
topology_id | |||
) |
Publish a TopologyDescriptionChangedEvent to all topology listeners. :Parameters: - `previous_description`: The previous topology description. - `new_description`: The new topology description. - `topology_id`: A unique identifier for the topology this server is a part of.
def publish_topology_opened | ( | self, | |
topology_id | |||
) |
Publish a TopologyOpenedEvent to all topology listeners. :Parameters: - `topology_id`: A unique identifier for the topology this server is a part of.