Package io.deephaven.kv
Interface KeyValuesCollectionListener
- All Known Implementing Classes:
KeyValuesCollectionListener.StateAdapter
public interface KeyValuesCollectionListener
A
watch listener style interface that presents a stateful
KeyValuesCollection.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAdapts aWatchClient.StateListenerinto aKeyValuesCollection. -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked on completion.voidInvoked on errors.voidonInitialState(@NotNull HeaderResponse header, @NotNull KeyValuesCollection state) Initializes the listener with the full initial state.voidonNextState(@NotNull WatchResponseUnit unit, @NotNull KeyValuesCollection state) Invoked on updates.
-
Method Details
-
onInitialState
void onInitialState(@NotNull @NotNull HeaderResponse header, @NotNull @NotNull KeyValuesCollection state) Initializes the listener with the full initial state.Listeners that want to hold on to the
statemust callKeyValuesCollection.asImmutable().Note: if there is an exception after this call, but before
WatchClient.Watch.startWatch()is called, the exception is *not* presented to this listener. (Todo: consider changing this.)- Parameters:
header- the headerstate- the key values state
-
onNextState
void onNextState(@NotNull @NotNull WatchResponseUnit unit, @NotNull @NotNull KeyValuesCollection state) Invoked on updates.Listeners that want to hold on to the
statemust callKeyValuesCollection.asImmutable().- Parameters:
unit- the watch response unitstate- the key values state AFTER applying unit changes
-
onError
Invoked on errors.May only be called once and if called it must be the last method called.
- Parameters:
t- the error
-
onCompleted
void onCompleted()Invoked on completion.May only be called once and if called it must be the last method called.
-