rrq-protocol
Wire protocol types for RRQ orchestrator-runner communication.
What is RRQ?
RRQ (Reliable Redis Queue) is a distributed job queue with a Rust orchestrator and language-flexible workers. This crate defines the protocol used for socket communication between the orchestrator and runner processes.
When to Use This Crate
Use rrq-protocol if you're:
- Building a custom runner in a new language
- Extending the RRQ protocol
- Debugging orchestrator-runner communication
For most use cases, use rrq-runner which wraps this protocol.
Installation
[]
= "0.9"
Protocol Overview
Messages are length-prefixed JSON frames over TCP:
┌─────────────────┬──────────────────────────────┐
│ Length (4B) │ JSON Payload (N bytes) │
│ Big-endian u32 │ UTF-8 encoded │
└─────────────────┴──────────────────────────────┘
Message Types
ExecutionRequest
Sent from orchestrator to runner when dispatching a job:
use ;
let request = ExecutionRequest ;
ExecutionOutcome
Returned from runner after job execution:
use ExecutionOutcome;
// Success
let outcome = success;
// Failure
let outcome = failure;
// Retry after delay
let outcome = retry_after;
CancelRequest
Sent to cancel an in-flight job:
use CancelRequest;
let cancel = CancelRequest ;
Frame Encoding
use ;
let message = Request ;
let frame: = encode_frame?;
Outcome Types
| Type | Description |
|---|---|
success |
Job completed |
failure |
Job failed (may retry) |
handler_not_found |
No handler for function |
timeout |
Exceeded deadline |
cancelled |
Job cancelled |
retry_after |
Retry after delay |
Related Crates
| Crate | Purpose |
|---|---|
rrq |
Orchestrator |
rrq-runner |
Runner runtime |
rrq-producer |
Job producer |
License
Apache-2.0