-
- All Implemented Interfaces:
-
io.getstream.chat.android.client.call.Call
public final class CoroutineCall<T extends Object> implements Call<T>
-
-
Constructor Summary
Constructors Constructor Description CoroutineCall(CoroutineScope scope, SuspendFunction0<Result<T>> runnable)
-
Method Summary
Modifier and Type Method Description Unitcancel()Cancels the execution of the call, if cancellation is supported for the operation. Result<T>execute()Executes the call synchronously, in a blocking way. Unitenqueue(Function1<Result<T>, Unit> callback)Executes the call asynchronously, on a background thread. -
-
Constructor Detail
-
CoroutineCall
CoroutineCall(CoroutineScope scope, SuspendFunction0<Result<T>> runnable)
-
-
Method Detail
-
cancel
Unit cancel()
Cancels the execution of the call, if cancellation is supported for the operation.
Note that calls can not be cancelled when running them with execute.
-
execute
Result<T> execute()
Executes the call synchronously, in a blocking way. Only call this from a background thread.
-
-
-
-