K
- the aggregate key typeC
- all commands for this aggregatepublic interface CommandAPI<K,C>
Modifier and Type | Interface and Description |
---|---|
static class |
CommandAPI.Request<K,C> |
Modifier and Type | Method and Description |
---|---|
default FutureResult<CommandError,Sequence> |
publishAndQueryCommand(CommandAPI.Request<K,C> commandRequest,
java.time.Duration timeout)
Chain together publishing a command then query the result.
|
FutureResult<CommandError,CommandId> |
publishCommand(CommandAPI.Request<K,C> request)
Submit the given command ready for processing.
|
FutureResult<CommandError,Sequence> |
queryCommandResult(CommandId commandId,
java.time.Duration timeout)
Get the result of the execution of the command identified by the provided UUID.
|
FutureResult<CommandError,CommandId> 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.FutureResult<CommandError,Sequence> queryCommandResult(CommandId commandId, java.time.Duration timeout)
Timeout
error code.commandId
- the CommandId of the command to lookup the result for.timeout
- how long to wait attempting to fetch the result before timing out.default FutureResult<CommandError,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.