Class Messenger


  • public class Messenger
    extends Object
    The Messenger is responsible for handling the outgoing message flow and sending messages to the recipient.
    • Method Detail

      • send

        public CompletableFuture<Void> send​(RelayableMessage message)
        Sends message to the recipient defined in the message. Throws a MessengerException if sending is not possible (e.g. because no path to the peer exists).

        The method tries to choose the best path to send the message to the recipient. Thus, it first checks whether the recipient can be reached locally. Then it searches for direct connections to the recipient. If there is no direct connection, the message is relayed to the Super Peer.

        Parameters:
        message - message to be sent
        Returns:
        a completed future if the message was successfully processed, otherwise an exceptionally future
      • setIntraVmSink

        public void setIntraVmSink​(MessageSink intraVmSink)
      • unsetIntraVmSink

        public void unsetIntraVmSink()
      • communicationOccurred

        public io.reactivex.rxjava3.core.Observable<CompressedPublicKey> communicationOccurred()
        Returns an Observable, which emits the CompressedPublicKey of each peer a message is sent to.
        Returns:
        an Observable, which emits the CompressedPublicKey of each peer a message is sent to