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 storing and applying claims #13

Closed autodidaddict closed 2 years ago

autodidaddict commented 2 years ago

In this PR, the lattice observer gains a new function apply_claims which takes a new struct (%Claims{}). These claims are immediately applied to the current contents of the observed lattice and then when heartbeats come into the lattice, the contents of the claims are used to augment the data on those heartbeats.

This has the net effect of allowing a consumer to start observing a lattice after all of the actor/provider started events have been published and, with the appropriate claims, rebuild a clean inventory from a set of heartbeats without having to resort to displaying "unavailable" (or worse, "") in description fields.

brooksmtownsend commented 2 years ago

BTW this worked swimmingly with my tests to properly populate a LatticeObserver with claims information from Jetstream 👍🏻