Session admission
Validate tenant, document, expiration, and scope before a client enters the collaborative channel.
Gleam protocol logic for collaborative systems
Spillway extracts the typed core of Fluid Framework sessions: sequencing, message validation, nacks, signals, summaries, and scoped JWT checks for BEAM systems that need predictable collaborative flow.
Protocol flow
Validate tenant, document, expiration, and scope before a client enters the collaborative channel.
Track connected clients, client sequence numbers, reference sequence numbers, and minimum sequence progression.
Build nacks, summaries, acks, and signals with typed constructors instead of ad-hoc JSON shapes.
Typed edges
Spillway keeps wire-format concerns explicit: clients join, ops receive sequence numbers, claims are checked, and invalid messages become protocol nacks.
import spillway
let state = spillway.new_sequence_state()
let joined = spillway.client_join(state, "client-7", 0)
case spillway.assign_sequence_number(joined, "client-7", 1, 0) {
Ok(result) -> result
Error(reason) -> reason
} Install
Spillway is intentionally small: Gleam stdlib plus JSON, ready to sit under a server layer that owns transport and persistence.
gleam add spillway