- All Known Implementing Classes:
Sync
public interface Cont<T>
Continuation of an asynchronous operation. The
bind(T) method gets called when the asynchronous operation completes with a
value; the trap(Throwable) method gets called when the asynchronous
operation fails with an exception.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> RunnableReturns aRunnablethat, when executed, invokes the givencontinuation with the provided constantvalue.voidInvoked when the asynchronous operation completes with avalue.static <X,T> Cont<X> Returns aContinuation that, when completed successfully, completes the givencontinuation with the provided constantvalue; and when failed with an error, fails the givencontinuation with the error.static <T> Cont<T>ignore()Returns aContcontinuation that, when completed successfully, does nothing; and when failed with an exception, throws the exception.static booleanisNonFatal(Throwable throwable) Returnstrueifthrowableis a recoverable exception; returnsfalseifthrowablecannot be recovered from.voidInvoked when the asynchronous operation fails with anerror.
-
Method Details
-
bind
Invoked when the asynchronous operation completes with avalue. -
trap
Invoked when the asynchronous operation fails with anerror. -
async
Returns aRunnablethat, when executed, invokes the givencontinuation with the provided constantvalue. -
constant
Returns aContinuation that, when completed successfully, completes the givencontinuation with the provided constantvalue; and when failed with an error, fails the givencontinuation with the error. -
ignore
Returns aContcontinuation that, when completed successfully, does nothing; and when failed with an exception, throws the exception. -
isNonFatal
Returnstrueifthrowableis a recoverable exception; returnsfalseifthrowablecannot be recovered from.
-