runtara-protocol 1.0.24

Wire protocol layer for runtara (QUIC transport and Protobuf messages)
Documentation

Runtara Protocol - QUIC + Protobuf communication layer

This crate provides the wire protocol for communication between:

  • Instances and runtara-core (instance protocol)
  • External clients and runtara-core (management protocol)

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    runtara-protocol                         │
├─────────────────────────────────────────────────────────────┤
│  RPC Layer: Request/Response + Bidirectional Streaming      │
├─────────────────────────────────────────────────────────────┤
│  Serialization: Protobuf (prost)                            │
├─────────────────────────────────────────────────────────────┤
│  Transport: QUIC (quinn)                                    │
└─────────────────────────────────────────────────────────────┘

Protocols

Instance Protocol (instance_proto)

Used by instances to communicate with runtara-core:

  • Registration, checkpointing, sleep/wake
  • Events (started, progress, completed, failed)
  • Signal polling and acknowledgment

Management Protocol (management_proto)

Used by external clients to manage runtara-core:

  • Health checks
  • Send signals to instances
  • Query instance status
  • List instances

Usage

Instance Client (scenarios)

use runtara_protocol::{RuntaraClient, RuntaraClientConfig, instance_proto};

let client = RuntaraClient::localhost()?;
client.connect().await?;

let request = instance_proto::RegisterInstanceRequest {
    instance_id: "my-instance".to_string(),
    tenant_id: "tenant-1".to_string(),
    checkpoint_id: None,
};

let rpc_request = instance_proto::RpcRequest {
    request: Some(instance_proto::rpc_request::Request::RegisterInstance(request)),
};

let response: instance_proto::RpcResponse = client.request(&rpc_request).await?;

Management Client

use runtara_protocol::{RuntaraClient, management_proto};

let client = RuntaraClient::localhost()?;
client.connect().await?;

let request = management_proto::HealthCheckRequest {};
let rpc_request = management_proto::RpcRequest {
    request: Some(management_proto::rpc_request::Request::HealthCheck(request)),
};

let response: management_proto::RpcResponse = client.request(&rpc_request).await?;