Package io.deephaven.kv
Interface WatchClient.StateListener<T>
- Type Parameters:
T- the stateful type
- All Known Subinterfaces:
FilesContext.FilesListener,PersistentQueriesContext.PersistentQueriesListener,RoutingFileContext.RoutingFileListener,SchemaContext.SchemasStateListener,UpdateInfoContext.UpdateInfoListener
- Enclosing interface:
- WatchClient
public static interface WatchClient.StateListener<T>
A
watch listener style interface for a stateful type T.-
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked on completion.voidInvoked on errors.voidonInitialState(@NotNull HeaderResponse header, T state) Invoked exactly once before the watch begins if thestateis present.voidonInitialStateNotPresent(@NotNull HeaderResponse header) Invoked exactly once before the watch begins if thestateis not present.voidonNextState(@NotNull WatchResponseUnit unit, T state) Invoked on new revisions where thestateis present.voidonNextStateNotPresent(@NotNull WatchResponseUnit unit) Invoked on new revisions where thestateis not present.
-
Method Details
-
onInitialState
Invoked exactly once before the watch begins if thestateis present.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 state
-
onInitialStateNotPresent
Invoked exactly once before the watch begins if thestateis not present.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 header
-
onNextState
Invoked on new revisions where thestateis present.Can be called many times but is never called after
onError(Throwable)oronCompleted()are called.- Parameters:
unit- the changes reflected in the current state updatestate- the state after applying updates in unit
-
onNextStateNotPresent
Invoked on new revisions where thestateis not present.Can be called many times but is never called after
onError(Throwable)oronCompleted()are called.- Parameters:
unit- the unit
-
onError
Invoked on errors.May only be called once and if called it must be the last method called.
- Parameters:
throwable- the error
-
onCompleted
void onCompleted()Invoked on completion.May only be called once and if called it must be the last method called.
-