Interface ConsumerNetworkClient.PollCondition

All Known Implementing Classes:
RequestFuture
Enclosing class:
ConsumerNetworkClient

public static interface ConsumerNetworkClient.PollCondition
When invoking poll from a multi-threaded environment, it is possible that the condition that the caller is awaiting has already been satisfied prior to the invocation of poll. We therefore introduce this interface to push the condition checking as close as possible to the invocation of poll. In particular, the check will be done while holding the lock used to protect concurrent access to NetworkClient, which means implementations must be very careful about locking order if the callback must acquire additional locks.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Return whether the caller is still awaiting an IO event.
  • Method Details

    • shouldBlock

      boolean shouldBlock()
      Return whether the caller is still awaiting an IO event.
      Returns:
      true if so, false otherwise.