public interface Synchronizer
extends java.io.Closeable
Interface for an asynchronous data source synchronizer.
A synchronizer will run and produce a stream of results. When it experiences a temporary failure, it will emit a status event indicating that it is INTERRUPTED, while it attempts to resolve its failure. When it receives data, it should emit a result containing a change set. When the data source is shut down gracefully, it should emit a status event indicating that it is SHUTDOWN.
[START] │ ▼ ┌─────────────┐ ┌─►│ RUNNING │──┐ │ └─────────────┘ │ │ │ │ │ │ │ │ │ │ │ │ └──► SHUTDOWN ───────────► [END] │ │ │ │ │ │ │ │ │ └──────► TERMINAL_ERROR ─────► [END] │ │ │ │ │ │ │ └──────────► GOODBYE ────────────┐ │ │ │ │ │ │ └──────────────► CHANGE_SET ─────────┤ │ │ │ │ └──────────────────► INTERRUPTED ────────┤ │ │ └────────────────────────────────────────────┘
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<FDv2SourceResult> |
next()
Get the next result from the stream.
|
java.util.concurrent.CompletableFuture<FDv2SourceResult> next()
This method is intended to be driven by a single thread, and for there to be a single outstanding call at any given time.
Once SHUTDOWN or TERMINAL_ERROR, has been produced, then no further calls to next() should be made.