Enum BlockingInAsyncDetection

    • Enum Constant Detail

      • DISABLED

        public static final BlockingInAsyncDetection DISABLED
        The detection of blocking in an asynchronous context is disabled.
      • IGNORE_COMPLETE_EXCEPTION_BLOCKING

        public static final BlockingInAsyncDetection IGNORE_COMPLETE_EXCEPTION_BLOCKING
        When asyncToSync() is called in an asynchronous context and the future it is passed would block, an exception will be thrown.
      • WARN_COMPLETE_EXCEPTION_BLOCKING

        public static final BlockingInAsyncDetection WARN_COMPLETE_EXCEPTION_BLOCKING
        When asyncToSync() is called in an asynchronous context and the future it is passed would block, an exception will be thrown; however, if the future is complete, then a warning will be logged.
      • IGNORE_COMPLETE_WARN_BLOCKING

        public static final BlockingInAsyncDetection IGNORE_COMPLETE_WARN_BLOCKING
        When asyncToSync() is called in an asynchronous context and the future it is passed would block, a warning is logged.
    • Method Detail

      • values

        public static BlockingInAsyncDetection[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (BlockingInAsyncDetection c : BlockingInAsyncDetection.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BlockingInAsyncDetection valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • ignoreComplete

        public boolean ignoreComplete()
        Indicates how to react if the future passed into asyncToSync() was completed. A return value of true indicates that this situation should be ignored, and a value of false indicates that a warning should be logged.
        Returns:
        whether completed future should be ignored
      • throwExceptionOnBlocking

        public boolean throwExceptionOnBlocking()
        Indicates how to react if the future passed into asyncToSync() has not yet been completed. A return value of true indicates that this situation should result in a BlockingInAsyncException, and a value of false indicates that a warning should be logged.
        Returns:
        whether non-completed future should throw an exception