fluxar
Universal asynchronous bidirectional messaging protocol for Rust. RPC + Streaming + PubSub in a single unified protocol.
⚠️ This crate is under active development and not yet functional. This is a name reservation for the upcoming Rust implementation of the FLUXAR protocol. See the specification for protocol details.
What is FLUXAR
FLUXAR is a transport-agnostic application protocol that unifies three communication patterns — request-response (RPC), streaming, and publish-subscribe — within a single envelope format.
After a handshake, both peers are equal: either side can call methods, open streams, subscribe to topics, and publish events.
Core design:
- 7 message types, 7-field envelope, CBOR serialisation
- The
refmechanism — a single field turns any message from request into response - Fully asynchronous — send and receive are independent, no head-of-line blocking
- Symmetric — no client/server distinction after handshake
- Transport-agnostic — WebSocket, TCP, QUIC, Unix socket
Planned Features
- Async-first API built on Tokio
- All four transports: WebSocket, TCP, QUIC, Unix socket
- Full streaming lifecycle with state machine (IDLE → ACTIVE → CANCELLING → CLOSED)
- PubSub with three delivery guarantee modes (at-most-once, at-least-once, exactly-once)
- Session resume after connection loss
- Optional Zstd/Gzip compression
- Optional end-to-end encryption (X25519 + AES-256-GCM / ChaCha20-Poly1305)
- Capability negotiation during handshake
- IDL-based code generation for typed clients and servers
Example (planned API)
// Server
let server = bind
.transport
.build
.await?;
server.handle;
server.run.await?;
// Client
let client = connect
.auth
.build
.await?;
let user: User = client.call.await?;
// Streaming
let stream = client.stream.await?;
while let Some = stream.next.await
// PubSub
client.subscribe.await?;
Note: The API above is illustrative and subject to change.
Specification
The full protocol specification is maintained at github.com/fluxar-protocol/spec.
| Layer | Description |
|---|---|
| L0: Transport | WebSocket, TCP, QUIC, Unix socket |
| L1: Framing | Message boundaries |
| L2: Wire Format | CBOR, optional compression and encryption |
| L3: Message | 7 types, envelope, ref mechanism |
| L4: Session | Handshake, auth, heartbeat, resume |
| L5: Patterns | RPC, Streaming, PubSub |
Conformance Levels
| Level | Description |
|---|---|
| FLUXAR Core | RPC only, one transport — minimal viable implementation |
| FLUXAR Complete | Full streaming, PubSub, resume, compression, encryption |
License
Apache-2.0 — see LICENSE.