Class MessageProtocolHandler

java.lang.Object
org.gradle.profiler.client.protocol.serialization.MessageProtocolHandler

public class MessageProtocolHandler extends Object
  • Constructor Details

    • MessageProtocolHandler

      public MessageProtocolHandler(String peerName, Connection connection)
  • Method Details

    • send

      public void send(Message message)
    • maybeReceive

      public <T extends Message> Optional<T> maybeReceive(Class<T> type, Duration timeout)
      Waits for the message for duration of timeout or returns Optional.empty() if waiting timeouts.
    • receive

      public <T extends Message> T receive(Class<T> type, Duration timeout)
      Waits for the message for duration of timeout and throws exception if waiting timeouts.