wasmCloud / lattice-observer

A reusable Elixir library for monitoring a lattice and deriving observed state
https://wasmcloud.com
Apache License 2.0
3 stars 2 forks source link

Support a pre-existing JetStream stream for events #8

Open autodidaddict opened 2 years ago

autodidaddict commented 2 years ago

The net result of these changes will make it so that, in the presence of a JetStream event stream for wasmbus.evt.* events, an observer can start at any time and automatically catch up, generating accurate state. It can also short-cut the amount of events it needs to read upon replay through the addition of a new cloud event, the lattice_snapshot_created event.

autodidaddict commented 2 years ago

Some JS reference - using the reply-to field on the messages we can tokenize the subject and obtain the pending count: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-15.md#jsack