Module remoc::robs::hash_map

source ·
Available on crate feature robs only.
Expand description

Observable hash map.

This provides a locally and remotely observable hash map. The observable hash map sends a change event each time a change is performed on it. The resulting event stream can either be processed event-wise or used to build a mirrored hash map.

Changes are sent using a remote broadcast channel, thus subscribers cannot block the observed hash map and are shed when their event buffer exceeds a configurable size.

§Basic use

Create a ObservableHashMap and obtain a subscription to it using ObservableHashMap::subscribe. Send this subscription to a remote endpoint via a remote channel and call HashMapSubscription::mirror on the remote endpoint to obtain a live mirror of the observed hash map or process each change event individually using HashMapSubscription::recv.

Structs§

Enums§

  • A view into a single entry in an observable hash map, which may either be vacant or occupied.
  • A hash map change event.