nv_ingest_client.message_clients.simple package#

Submodules#

nv_ingest_client.message_clients.simple.simple_client module#

class nv_ingest_client.message_clients.simple.simple_client.SimpleClient(
host: str,
port: int,
db: int = 0,
max_retries: int = 3,
max_backoff: int = 32,
connection_timeout: int = 300,
max_pool_size: int = 128,
use_ssl: bool = False,
)[source]#

Bases: MessageBrokerClientBase

A client for interfacing with SimpleMessageBroker, creating a new socket connection per request to ensure thread safety and robustness. Respects timeouts for all operations.

fetch_message(
queue_name: str,
timeout: float | None = None,
) ResponseSchema[source]#

Fetch a message from the specified queue.

Parameters:
  • queue_name (str) – The name of the queue to fetch the message from.

  • timeout (float, optional) – Timeout in seconds for the operation (default is None).

Returns:

The response containing the fetched message or an error.

Return type:

ResponseSchema

get_client()[source]#

Get the current instance of the SimpleClient.

Returns:

The current instance of SimpleClient.

Return type:

SimpleClient

ping() ResponseSchema[source]#

Ping the message broker to check connectivity.

Returns:

The response indicating success or failure.

Return type:

ResponseSchema

size(
queue_name: str,
) ResponseSchema[source]#

Fetch the current number of items in the specified queue.

Parameters:

queue_name (str) – The name of the queue.

Returns:

The response containing the size of the queue or an error.

Return type:

ResponseSchema

submit_message(
queue_name: str,
message: str,
timeout: float | None = None,
for_nv_ingest: bool = False,
) ResponseSchema[source]#

Submit a message to the specified queue.

Parameters:
  • queue_name (str) – The name of the queue to submit the message to.

  • message (str) – The message to submit.

  • timeout (float, optional) – Timeout in seconds for the operation (default is None).

  • for_nv_ingest (bool, optional) – Whether this is a specialized NV ingest operation (default is False).

Returns:

The response from the message broker.

Return type:

ResponseSchema

Module contents#