ocrd_network.rabbitmq_utils package

class ocrd_network.rabbitmq_utils.RMQConsumer(host: str = 'localhost', port: int = 5672, vhost: str = '/')[source]

Bases: RMQConnector

authenticate_and_connect(username: str, password: str) None[source]
setup_defaults() None[source]
get_one_message(queue_name: str, auto_ack: bool = False) Any | None[source]
configure_consuming(queue_name: str, callback_method: Any) None[source]
start_consuming() None[source]
get_waiting_message_count() int | None[source]
ack_message(delivery_tag: int) None[source]
class ocrd_network.rabbitmq_utils.RMQConnector(host: str = 'localhost', port: int = 5672, vhost: str = '/')[source]

Bases: object

static declare_and_bind_defaults(connection: BlockingConnection, channel: BlockingChannel) None[source]
static open_blocking_connection(credentials: PlainCredentials, host: str = 'localhost', port: int = 5672, vhost: str = '/') BlockingConnection[source]
static open_blocking_channel(connection: BlockingConnection) BlockingChannel | None[source]
static exchange_bind(channel: BlockingChannel, destination_exchange: str, source_exchange: str, routing_key: str, arguments: Any | None = None) None[source]
static exchange_declare(channel: BlockingChannel, exchange_name: str, exchange_type: str, passive: bool = False, durable: bool = False, auto_delete: bool = False, internal: bool = False, arguments: Any | None = None) None[source]
static exchange_delete(channel: BlockingChannel, exchange_name: str, if_unused: bool = False) None[source]
static exchange_unbind(channel: BlockingChannel, destination_exchange: str, source_exchange: str, routing_key: str, arguments: Any | None = None) None[source]
static queue_bind(channel: BlockingChannel, queue_name: str, exchange_name: str, routing_key: str, arguments: Any | None = None) None[source]
static queue_declare(channel: BlockingChannel, queue_name: str, passive: bool = False, durable: bool = False, exclusive: bool = False, auto_delete: bool = False, arguments: Any | None = None) None[source]
static queue_delete(channel: BlockingChannel, queue_name: str, if_unused: bool = False, if_empty: bool = False) None[source]
static queue_purge(channel: BlockingChannel, queue_name: str) None[source]
static queue_unbind(channel: BlockingChannel, queue_name: str, exchange_name: str, routing_key: str, arguments: Any | None = None) None[source]
static set_qos(channel: BlockingChannel, prefetch_size: int = 0, prefetch_count: int = 1, global_qos: bool = False) None[source]
static confirm_delivery(channel: BlockingChannel) None[source]
static basic_publish(channel: BlockingChannel, exchange_name: str, routing_key: str, message_body: bytes, properties: BasicProperties) None[source]
class ocrd_network.rabbitmq_utils.RMQPublisher(host: str = 'localhost', port: int = 5672, vhost: str = '/')[source]

Bases: RMQConnector

authenticate_and_connect(username: str, password: str) None[source]
setup_defaults() None[source]
create_queue(queue_name: str, exchange_name: str | None = None, exchange_type: str | None = None, passive: bool = False) None[source]
publish_to_queue(queue_name: str, message: bytes, exchange_name: str | None = None, properties: BasicProperties | None = None) None[source]
enable_delivery_confirmations() None[source]
class ocrd_network.rabbitmq_utils.OcrdProcessingMessage(job_id: str, processor_name: str, created_time: int, input_file_grps: List[str], output_file_grps: List[str] | None, path_to_mets: str | None, workspace_id: str | None, page_id: str | None, result_queue_name: str | None, callback_url: str | None, internal_callback_url: str | None, parameters: Dict[str, Any] | None = None)[source]

Bases: object

static encode_yml(ocrd_processing_message: OcrdProcessingMessage) bytes[source]
static decode_yml(ocrd_processing_message: bytes) OcrdProcessingMessage[source]
class ocrd_network.rabbitmq_utils.OcrdResultMessage(job_id: str, state: str, path_to_mets: str | None = None, workspace_id: str | None = None)[source]

Bases: object

static encode_yml(ocrd_result_message: OcrdResultMessage) bytes[source]
static decode_yml(ocrd_result_message: bytes) OcrdResultMessage[source]

Submodules