Package 

Class CoroutineCall

  • All Implemented Interfaces:
    io.getstream.chat.android.client.call.Call

    
    public final class CoroutineCall<T extends Object>
     implements Call<T>
                        
    • Method Summary

      Modifier and Type Method Description
      Result<T> execute() Executes the call synchronously, in a blocking way.
      Result<T> await() Awaits the result of this Call in a suspending way, asynchronously.
      Unit cancel() Cancels the execution of the call.
      Unit enqueue(Call.Callback<T> callback) Executes the call asynchronously, on a background thread.
      • Methods inherited from class io.getstream.chat.android.client.call.CoroutineCall

        enqueue
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • execute

         Result<T> execute()

        Executes the call synchronously, in a blocking way. Only call this from a background thread.

      • await

         Result<T> await()

        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.

      • cancel

         Unit cancel()

        Cancels the execution of the call.

      • enqueue

         Unit enqueue(Call.Callback<T> callback)

        Executes the call asynchronously, on a background thread. Safe to call from the main thread.

        The callback will only be invoked in case the Call is not canceled, and always on the main thread.