Package io.hekate.network
Interface NetworkSendCallback<T>
-
- Type Parameters:
T
-NetworkEndpoint
's base message type.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface NetworkSendCallback<T>
Callback for getting results of an asynchronous messages sending operation inNetworkEndpoint
.Note that this callback is called on the
NetworkEndpoint
's NIO thread. It must be executed as fast as possible in order to prevent blocking other endpoints that can be associated with the same thread. In case of long/heavy computations consider scheduling such tasks to another thread.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onComplete(T msg, Throwable error)
Called whenmessage sending
completes either successfully or with an error.
-
-
-
Method Detail
-
onComplete
void onComplete(T msg, Throwable error)
Called whenmessage sending
completes either successfully or with an error.- Parameters:
msg
- Submitted message.error
- Error if happened ornull
if operation was successful.
-
-