Interface MessageFunction
-
- All Superinterfaces:
AutoCloseable,NoErrorAutoClosable
public interface MessageFunction extends NoErrorAutoClosable
MessageFunctionssimplify the execution of request-reply based communications over an asynchronousMessageBus.- See Also:
- EventMaid Documentation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes theMessageFunction.ResponseFuturerequest(EventType eventType, Object request)Sends the given request over theMessageBus.
-
-
-
Method Detail
-
request
ResponseFuture request(EventType eventType, Object request)
Sends the given request over theMessageBus.The returned
ResponseFuturefulfills, when a response is received or an exception during the transport of request or the reply is thrown.- Parameters:
eventType- theEventTypeof the requestrequest- the request to send- Returns:
- a
ResponseFuturethat can be queried for the result
-
close
void close()
Closes theMessageFunction. This does not cancel any pendingResponseFutures.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceNoErrorAutoClosable
-
-