CX · Reference guidecx-platform-fabric
PlaygroundDownloadsAboutv0.18.0-pre.1

cx-platform-fabric

messaging and fabric-serve

Why reach for it

Messaging with the durability written on it. cx-platform-fabric is publish/subscribe and request/reply over the primitives this site already ships: the durable plane rides the store's journal — a published event is appended to a named stream, attributed, in a per-stream total order on a hash chain — and the transient plane is an emit whose latest value wins. A subscription says which plane it reads from, so nothing is at-least-once by accident.

A subscription carries a pattern and, when it names a group, an offset: receive a batch, ack it, and a second subscriber in the same group resumes after the acknowledged sequence — the corpus opens a fresh subscription to prove it. An observer with no group cannot acknowledge, an ungrouped ack is refused, and an uncommitted tail is redelivered. The offset is store data, readable by the same query verbs as anything else in the journal.

Poison is a policy, not a surprise: a dead-letter rule names the stream, the group and the attempt count, a message that keeps failing is moved to the dead-letter stream in an envelope that says why, and the group unblocks; a rule that would loop a stream into itself is refused when it is declared. Request/reply registers a responder and answers a synchronous call, or an error when no responder is registered. The same handle opens embedded over a journal element or remote over xsp://, where the dial needs the net grant and a tenant, and fabric-serve is the daemon on the other end.

What it gives you

One module of the platform group, the whole surface — open, publish, subscribe, receive, ack, emit, read, respond, request — linking to the reference page projected from its own documentation.

module import it as where it lives reference
fabric [?lib 'cx-platform/fabric'] Ring 1 · the platform group fabric reference

Try it

One durable publish to orders, then a subscription on a glob pattern over the same stream and a batched receive: one event, matched by its pattern, from an in-memory journal that needed no grant.

prog.cx

        [?lib 'cx-platform/journal']
[?lib 'cx-platform/fabric' as=fabric]
[?let [= $j [$journal:open "mem://t" "acme"]]
  [= $f [$fabric:open $j]]
  [= $r [$fabric:publish $f "orders" [do :order.placed] {actor: "u" authority: "g"}]]
  [= $s [$fabric:subscribe $f "orders" :order.*]]
  [$count [?receive from=$s max=9]]]
      
        $ cx prog.cx
1
      

Fixture fabric-004-subscribe-glob-receive in deps/cx-platform-fabric/conformance/platform/fabric.cxd — replayed against this cx when the page was built.

Status

The fabric builds on the store, identity, the wire and the session layer, and is built on by the application host; the front door compiles its V module from the pin, and the module's own initialisation registers fabric-serve as a verb of the binary.

fact as the registry records it
ships as binary
status extracted
pinned at d1c0a4cff
builds on cx-platform-store, cx-platform-identity, cx-platform-net, cx-platform-xsp
built on by cx-platform-xap
bundled modules 1
BUILDS ON THIS REPOSITORY · SHIPS BUILT ON BY cx-platform-store cx-platform-identity cx-platform-net cx-platform-xsp cx-platform-fabric fabric cx-platform-xap DRAWN FROM registry/repos.cxd's pins= COLUMN AND registry/modules.cxd WHEN THIS PAGE WAS BUILT
Fig. — what cx-platform-fabric plugs into: the repositories it builds on (left), the modules it ships (centre), the repositories that build on it (right) · drawn from registry/repos.cxd, deps.cxd and registry/modules.cxd when this page was built