-
public final class CallKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> Result<T>await(Call<T> $self)Awaits the result of this Call in a suspending way, asynchronously. final static <T extends Any> Unitlaunch(Call<T> $self, CoroutineScope scope)Runs a call using coroutines scope final static <T extends Any, K extends Any> Call<K>map(Call<T> $self, Function1<T, K> mapper)final static <T extends Any, K extends Any> Call<Pair<T, K>>zipWith(Call<T> $self, Call<K> call)final static <T extends Any> Call<T>doOnStart(Call<T> $self, CoroutineScope scope, SuspendFunction0<Unit> function)final static <T extends Any> Call<T>doOnResult(Call<T> $self, CoroutineScope scope, SuspendFunction1<Result<T>, Unit> function)final static <T extends Any> Call<T>withPrecondition(Call<T> $self, CoroutineScope scope, SuspendFunction0<Result<Unit>> precondition)final static <T extends Any> ReturnOnErrorCall<T>onErrorReturn(Call<T> $self, CoroutineScope scope, SuspendFunction1<ChatError, Result<T>> function)Wraps this Call into ReturnOnErrorCall to return an item specified by side effect function when it encounters an error. final static Call<Unit>toUnitCall(Call<?> $self)final static <T extends Any> Unitenqueue(Call<T> $self, Function1<T, Unit> onSuccess, Function1<ChatError, Unit> onError)-
-
Method Detail
-
await
final static <T extends Any> Result<T> await(Call<T> $self)
Awaits the result of this Call in a suspending way, asynchronously. Safe to call from any CoroutineContext.
Does not throw exceptions. Any errors will be wrapped in the Result that's returned.
-
launch
final static <T extends Any> Unit launch(Call<T> $self, CoroutineScope scope)
Runs a call using coroutines scope
-
zipWith
final static <T extends Any, K extends Any> Call<Pair<T, K>> zipWith(Call<T> $self, Call<K> call)
-
doOnStart
final static <T extends Any> Call<T> doOnStart(Call<T> $self, CoroutineScope scope, SuspendFunction0<Unit> function)
-
doOnResult
final static <T extends Any> Call<T> doOnResult(Call<T> $self, CoroutineScope scope, SuspendFunction1<Result<T>, Unit> function)
-
withPrecondition
final static <T extends Any> Call<T> withPrecondition(Call<T> $self, CoroutineScope scope, SuspendFunction0<Result<Unit>> precondition)
-
onErrorReturn
final static <T extends Any> ReturnOnErrorCall<T> onErrorReturn(Call<T> $self, CoroutineScope scope, SuspendFunction1<ChatError, Result<T>> function)
Wraps this Call into ReturnOnErrorCall to return an item specified by side effect function when it encounters an error.
- Parameters:
scope- Scope of coroutine in which to execute side effect function.
-
toUnitCall
final static Call<Unit> toUnitCall(Call<?> $self)
-
-
-
-