ocrd_network.processing_worker module

Abstraction for the Processing Server unit in this arch: https://user-images.githubusercontent.com/7795705/203554094-62ce135a-b367-49ba-9960-ffe1b7d39b2c.jpg

Calls to native OCR-D processor should happen through the Processing Worker wrapper to hide low level details. According to the current requirements, each ProcessingWorker is a single OCR-D Processor instance.

class ocrd_network.processing_worker.ProcessingWorker(rabbitmq_addr, mongodb_addr, processor_name, ocrd_tool: dict, processor_class=None)[source]

Bases: object

connect_consumer() None[source]
connect_publisher(enable_acks: bool = True) None[source]
on_consumed_message(channel: BlockingChannel, delivery: Deliver, properties: BasicProperties, body: bytes) None[source]
start_consuming() None[source]
process_message(processing_message: OcrdProcessingMessage) None[source]
publish_to_result_queue(result_queue: str, result_message: OcrdResultMessage)[source]
create_queue(connection_attempts: int = 3, retry_delay: int = 3) None[source]

Create the queue for this worker

Originally only the processing-server created the queues for the workers according to the configuration file. This is intended to make external deployment of workers possible.