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()[source]
connect_publisher(enable_acks: bool = True)[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_result_to_all(processing_message: OcrdProcessingMessage, result_message: OcrdResultMessage)[source]
publish_to_result_queue(result_queue: str, result_message: OcrdResultMessage)[source]