Command Request
Allows to post a command optionally subscribing to events that are immediate results of handling this command.
Usage example:
Subscription loginSubscription =
client.asGuest()
.command(logInUser)
.observe(UserLoggedIn.class, (event, context) -> { ... })
.observe(UserAlreadyLoggedIn.class, (rejection, context) -> { ... })
.onStreamingError((throwable) -> { ... })
.post();
Content copied to clipboard
The subscription obtained from the post should be cancelled to preserve both client-side and server-side resources. The moment of cancelling the subscriptions depends on the nature of the posted command and the outcome expected by the client application.
Functions
Link copied to clipboard
Adds the passed event consumer to the subscribers of the event of the passed type.
Adds the passed consumer to the subscribers of the event of the passed type.
Link copied to clipboard
Assigns a handler for errors occurred in consumers of events.
Link copied to clipboard
Assigns a handler for an error occurred on the server-side (such as validation error) in response to posting a command.
Link copied to clipboard
Assigns a handler for errors occurred when delivering events.
Link copied to clipboard
Posts the command without subscribing to events that may be generated during the command handling.