Class NonBlocking

java.lang.Object
com.oracle.coherence.common.base.NonBlocking
All Implemented Interfaces:
AutoCloseable

public class NonBlocking extends Object implements AutoCloseable
NonBlocking allows a thread to mark itself as non-blocking and should be exempt from things such as flow-control pauses using a try-with-resource pattern.
 try (NonBlocking e = new NonBlocking())
     {
     // NonBlocking.isNonBlockingCaller() will now be true, and FlowControlled elements should respect this and not block
     }
 // NonBlocking.isNonBlockingCaller() will have been restored to its former value
 
  • Constructor Details

    • NonBlocking

      public NonBlocking()
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • isNonBlockingCaller

      public static boolean isNonBlockingCaller()
      Return true if the the calling thread has been marked as non-blocking
      Returns:
      true iff the calling thread is marked as non-blocking