Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None

    Description

      It needs to design convinient public API for networking module which allow to get information about network members and send/receive messages from them.

      Draft:

      public interface NetworkService {
          static NetworkService create(NetworkConfiguration cfg);    
      
          void shutdown() throws ???;    NetworkMember localMember();
          
          Collection<NetworkMember> remoteMembers();
          
          void weakSend(NetworkMember member, Message msg);    
      
          Future<?> guaranteedSend(NetworkMember member, Message msg);
          
          void listenMembers(MembershipListener lsnr);
          
          void listenMessages(Consumer<MessagingEvent> lsnr);
      }
      
      public interface MembershipListener {
          void onAppeared(NetworkMember member);
          void onDisappeared(NetworkMember member);
          void onAcceptedByGroup(List<NetworkMember> remoteMembers);
      }
      
      public interface NetworkMember {
          UUID id();
      }
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            akalashnikov Anton Kalashnikov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: