Class Conts


  • public final class Conts
    extends Object
    Factory functions for Continuation combinators.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> Runnable async​(Cont<T> cont, T value)
      Returns a Runnable that, when executed, invokes the given continuation with the provided constant value.
      static <X,​T>
      Cont<X>
      constant​(Cont<T> cont, T value)
      Returns a Continuation that, when completed successfully, completes the given continuation with the provided constant value; and when failed with an error, fails the given continuation with the error.
      static <T> Cont<T> ignore()
      Returns a Cont continuation that, when completed successfully, does nothing; and when failed with an exception, throws the exception.
      static boolean isNonFatal​(Throwable throwable)
      Returns true if throwable is a recoverable exception; returns false if throwable cannot be recovered from.
    • Method Detail

      • async

        public static <T> Runnable async​(Cont<T> cont,
                                         T value)
        Returns a Runnable that, when executed, invokes the given continuation with the provided constant value.
      • constant

        public static <X,​T> Cont<X> constant​(Cont<T> cont,
                                                   T value)
        Returns a Continuation that, when completed successfully, completes the given continuation with the provided constant value; and when failed with an error, fails the given continuation with the error.
      • ignore

        public static <T> Cont<T> ignore()
        Returns a Cont continuation that, when completed successfully, does nothing; and when failed with an exception, throws the exception.
      • isNonFatal

        public static boolean isNonFatal​(Throwable throwable)
        Returns true if throwable is a recoverable exception; returns false if throwable cannot be recovered from.