Package com.naver.ads.deferred
Object Deferrer
-
-
Method Summary
Modifier and Type Method Description final static <TResult extends Any> Deferred<TResult>forResult(TResult result)Creates a completed Deferred with the given result. final static <TResult extends Any> Deferred<TResult>forException(Exception exception)Creates a faulted Deferred with the given exception. final static <TResult extends Any> Deferred<TResult>forCanceled()Creates a cancelled Deferred. final static <TResult extends Any> Deferred<TResult>call(Callable<TResult> callable, Executor executor)Invokes the callable using the given executor, returning a Deferred to represent the operation. final static <TResult extends Any> Deferred<TResult>call(Callable<TResult> callable)Invokes the callable using the given executor, returning a Deferred to represent the operation. final static <TResult extends Any> Deferred<TResult>callInBackground(Callable<TResult> callable)Invokes the callable on a background thread, returning a Deferred to represent the operation. final static <TResult extends Any> TResultawait(Deferred<TResult> deferred)Blocks until the given deferred is complete. final static <TResult extends Any> TResultawait(Deferred<TResult> deferred, Long timeout)Block until the given deferred is completed within the given timeout. -
-
Method Detail
-
forException
final static <TResult extends Any> Deferred<TResult> forException(Exception exception)
-
forCanceled
final static <TResult extends Any> Deferred<TResult> forCanceled()
Creates a cancelled Deferred.
-
call
@JvmOverloads() final static <TResult extends Any> Deferred<TResult> call(Callable<TResult> callable, Executor executor)
-
call
@JvmOverloads() final static <TResult extends Any> Deferred<TResult> call(Callable<TResult> callable)
-
callInBackground
final static <TResult extends Any> Deferred<TResult> callInBackground(Callable<TResult> callable)
Invokes the callable on a background thread, returning a Deferred to represent the operation.
-
await
final static <TResult extends Any> TResult await(Deferred<TResult> deferred)
Blocks until the given deferred is complete.
-
-
-
-