K - the aggregate key typeC - all commands for this aggregatepublic interface CommandAPI<K,C>
| Modifier and Type | Interface | Description |
|---|---|---|
static class |
CommandAPI.Request<K,C> |
| Modifier and Type | Method | Description |
|---|---|---|
default io.simplesource.data.FutureResult<CommandError,io.simplesource.data.Sequence> |
publishAndQueryCommand(CommandAPI.Request<K,C> commandRequest,
java.time.Duration timeout) |
Chain together publishing a command then query the result.
|
io.simplesource.data.FutureResult<CommandError,UUID> |
publishCommand(CommandAPI.Request<K,C> request) |
Submit the given command ready for processing.
|
io.simplesource.data.FutureResult<CommandError,io.simplesource.data.Sequence> |
queryCommandResult(UUID commandId,
java.time.Duration timeout) |
Get the result of the execution of the command identified by the provided UUID.
|
io.simplesource.data.FutureResult<CommandError,UUID> publishCommand(CommandAPI.Request<K,C> request)
request - command request.FutureResult with the commandId echoed back if the command was successfully queued,
otherwise a list of reasons for the failure.io.simplesource.data.FutureResult<CommandError,io.simplesource.data.Sequence> queryCommandResult(UUID commandId, java.time.Duration timeout)
Timeout error code.commandId - the UUID of the command to lookup the result for.timeout - how long to wait attempting to fetch the result before timing out.default io.simplesource.data.FutureResult<CommandError,io.simplesource.data.Sequence> publishAndQueryCommand(CommandAPI.Request<K,C> commandRequest, java.time.Duration timeout)
commandRequest - the command request.timeout - how long to wait for processing to complete and the result to be available.Copyright © 2019. All rights reserved.