Interface KvWatchEvent
-
- All Implemented Interfaces:
public interface KvWatchEvent<T extends Object>What a Key-Value watch delivers when the initial snapshot is worth telling apart from the changes that follow it
A watch begins by replaying what the bucket already holds and only then follows live changes, with nothing in the element type to say where one ends and the other begins. The signal that separates them is a callback on the jnats watcher, not a value (
io/nats/client/api/Watcher.java:30-34), so natsy carries it as an element of its own: warm a cache from every Entry, flip the readiness probe on InitialSyncComplete, and treat what arrives afterwards as an update.InitialSyncComplete arrives exactly once per watch, and every entry of the initial snapshot precedes it - both are sent from the one dispatcher thread that delivers them, in the order it delivers them (
io/nats/client/impl/NatsKeyValueWatchSubscription.java:76-79,io/nats/client/impl/NatsDispatcher.java:108). A connection built withjnatsOptions { useDispatcherWithExecutor() }hands delivery to a pool instead, and voids that ordering. An empty bucket, and a KvWatchOption.UPDATES_ONLY watch, complete their sync with no entry at all.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classKvWatchEvent.EntryOne revision of one key, exactly as eu.vstoyanov.natsy.jetstream.KeyValueStore.watch emits it
public classKvWatchEvent.InitialSyncCompleteEverything the bucket already held has been delivered; what follows is a change
-