Generic ZMQ-based distributed execution framework extracted from OpenHCS.
- Client-Server Architecture: Simple ZMQ-based client and server for distributed task execution
- Multiple Transport Modes: Support for TCP and IPC transports
- Message Protocol: Typed message classes for requests, responses, progress updates, and control messages
- Queue Tracking: Built-in queue tracking for monitoring execution status
- Acknowledgment System: Global acknowledgment listener for reliable message delivery
pip install zmqruntimefrom zmqruntime import ZMQServer, serve_forever
# Create and start a server
server = ZMQServer(port=7777)
serve_forever(server)from zmqruntime import ZMQClient, ExecuteRequest
# Connect to the server
client = ZMQClient(port=7777)
# Send an execution request
request = ExecuteRequest(
execution_id="task-001",
payload={"task": "process_data"}
)
response = client.send_request(request)ZMQServer: Server that listens for and processes execution requestsZMQClient: Client for sending requests to the serverExecuteRequest/ExecuteResponse: Request/response message typesProgressUpdate: Progress reporting during executionQueueTracker: Track pending and active executionsGlobalAckListener: Acknowledgment handling for reliable delivery
from zmqruntime import ZMQConfig, TransportMode
# TCP transport (default)
config = ZMQConfig(port=7777, transport_mode=TransportMode.TCP)
# IPC transport (Unix sockets)
config = ZMQConfig(port=7777, transport_mode=TransportMode.IPC)MIT License - see LICENSE file for details.