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 in NetworkEndpoint.

    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 Detail

      • onComplete

        void onComplete​(T msg,
                        Throwable error)
        Called when message sending completes either successfully or with an error.
        Parameters:
        msg - Submitted message.
        error - Error if happened or null if operation was successful.