Skip to main content

Module memory

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:

  1. The oracle. happenstance-sync-testkit’s suite is pointed at this peer first (its memory_sync_conformance test): 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 are todo!() 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’s tests/.
  2. The doctest target. Every example in this crate that needs a peer uses this one, so the examples run rather than merely compile.
  3. 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§

MemoryResume
Where a MemorySyncPeer pull left off.
MemorySyncPeer
An in-memory peer.

Enums§

MemoryPeerError
How MemorySyncPeer fails.