Interface UnicastService

All Known Subinterfaces:
ManagedUnicastService
All Known Implementing Classes:
NettyUnicastService

public interface UnicastService
Service for unreliable unicast messaging between nodes.

The broadcast service is an unreliable broadcast messaging service backed by multicast. This service provides no guaranteed regarding reliability or order of messages.

  • Method Details

    • unicast

      void unicast(Address address, String subject, byte[] message)
      Broadcasts the given message to all listeners for the given subject.

      The message will be broadcast to all listeners for the given subject. This service makes no guarantee regarding the reliability or order of delivery of the message.

      Parameters:
      address - the address to which to unicast the message
      subject - the message subject
      message - the message to broadcast
    • addListener

      default void addListener(String subject, BiConsumer<Address,byte[]> listener)
      Adds a broadcast listener for the given subject.

      Messages broadcast to the given subject will be delivered to the provided listener. This service provides no guarantee regarding the order in which messages arrive.

      Parameters:
      subject - the message subject
      listener - the broadcast listener to add
    • addListener

      void addListener(String subject, BiConsumer<Address,byte[]> listener, Executor executor)
      Adds a broadcast listener for the given subject.

      Messages broadcast to the given subject will be delivered to the provided listener. This service provides no guarantee regarding the order in which messages arrive.

      Parameters:
      subject - the message subject
      listener - the broadcast listener to add
      executor - an executor with which to call the listener
    • removeListener

      void removeListener(String subject, BiConsumer<Address,byte[]> listener)
      Removes a broadcast listener for the given subject.
      Parameters:
      subject - the message subject
      listener - the broadcast listener to remove