Interface IRequestHandlerBuilder
- All Superinterfaces:
Serializable
Builder for performing more than one cross scope conversation request and performing some logic when all have
finished.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionbooleanperform(Consumer<Map<UUID, IRequestResult>> onDone) Starts all requests added viarequestand calls the callback when all requests have finished.<T extends Serializable,R extends ICrossViewScopeRequest<T>>
UUIDrequest(R request, Duration timeout, ICrossViewScopeResponseConsumer<? super T> handler) Adds a request (but does not start it yet).
-
Method Details
-
request
<T extends Serializable,R extends ICrossViewScopeRequest<T>> UUID request(R request, Duration timeout, ICrossViewScopeResponseConsumer<? super T> handler) Adds a request (but does not start it yet). SeeDesignerConversationBean.request(ICrossViewScopeRequest, Duration, ICrossViewScopeResponseConsumer, BackendViewPushContext)for more details.- Type Parameters:
T- Type of the requested data.R- Type of the request.- Parameters:
request- Request to send.timeout- Timeout to set on the request. When no response is received within this time frame, the handler is invoked with an error.handler- Handler to invoke when the request completes either successfully or erroneously.- Returns:
- The UUID for the request that can be used to retrieve the result in the
perform(Consumer)method.
-
perform
Starts all requests added viarequestand calls the callback when all requests have finished.- Parameters:
onDone- Callback invoked when all requests have finished (whether successful or not).- Returns:
trueif there are any pending responses,falseif all requests have been processed, such as when no handlers did respond to the request.
-