Skip to main content

Crate majra

Crate majra 

Source
Expand description

§Majra

مجرا (Arabic/Persian: conduit, channel) — Distributed queue & multiplex engine.

Shared messaging primitives for the AGNOS ecosystem, eliminating duplicate pub/sub, queue, relay, and heartbeat implementations across AgnosAI, daimon, SecureYeoman, and sutra.

Pure Rust, async-native — built on tokio, zero-copy where possible.

§Feature flags

FeatureDefaultDescription
pubsubyesThree-tier pub/sub: DirectChannel (73M/s), HashedChannel (16M/s), TypedPubSub (1.1M/s with wildcards)
queueyesMulti-tier priority queue with DAG dependency scheduling
relayyesSequenced, deduplicated inter-node message relay
ipcnoLength-prefixed framing over Unix domain sockets
heartbeatyesTTL-based health tracking with Online→Suspect→Offline FSM
ratelimitnoPer-key token bucket rate limiter
barriernoN-way barrier synchronisation with deadlock recovery
sqlitenoSQLite persistence for managed queue
fleetnoDistributed job queue with work-stealing
redis-backendnoRedis-backed cross-process pub/sub and queues
prometheusnoBuilt-in Prometheus metrics exporter
quicnoQUIC transport with multiplexed streams and datagrams
ipc-encryptednoAES-256-GCM encrypted IPC channels
postgresnoPostgreSQL persistence for workflow storage
wsnoWebSocket bridge for pub/sub fan-out
fullEnables all features

Modules§

envelope
Message envelope — the universal wire type for majra.
error
Shared error types for majra.
heartbeat
TTL-based node health tracking.
metrics
Observability hooks for majra primitives.
namespace
Tenant-scoped wrappers for majra primitives.
pubsub
Topic-based pub/sub with MQTT-style wildcard matching.
queue
Multi-tier priority queue with DAG dependency scheduling.
relay
Sequenced, deduplicated inter-node message relay.
transport
Pluggable transport layer for the relay.