Module memory
Available on crate feature
memory only.Expand description
An in-memory SyncPeer, behind the memory feature.
It is a peer, not a store: it holds whatever was pushed to it and hands it back on pull. Two of them wired to each other is the smallest thing that exercises a runner.
§Why it exists: three jobs, one type
The same three happenstance-core gives for MemoryEventStore, one port
over, and the same cold start the projection port had without one:
- The oracle.
happenstance-sync-testkit’s suite is pointed at this peer first (itsmemory_sync_conformancetest): the reference peer every conformance rule must pass against before it may fail a real adapter. A rule red here is a wrong rule, not a wrong peer. So the bodies are real — a fixture whose methods aretodo!()cannot be the thing a suite is pointed at — and that is the difference between this type and the two stand-ins in this crate’stests/. - The doctest target. Every example in this crate that needs a peer uses this one, so the examples run rather than merely compile.
- Something to test against. An application author can write and test
their sync wiring before a real peer exists, as
MemorySyncPeer’s example shows.
§Behind a feature, and not a default
A deployment never replicates to a peer that lives in its own memory, so the
type is off unless asked for: features = ["memory"], normally in
[dev-dependencies].
Structs§
- Memory
Resume - Where a
MemorySyncPeerpull left off. - Memory
Sync Peer - An in-memory peer.
Enums§
- Memory
Peer Error - How
MemorySyncPeerfails.