startSuspending

abstract suspend fun startSuspending(    lifetime: Lifetime,     request: TReq,     responseScheduler: IScheduler? = null): TRes

Asynchronously invokes the API with the parameters given as request and waits for the result suspending.

Parameters

lifetime

cancellation token and lifetime of the result if it is bindable. The lifetime of the counterpart will be terminated when this lifetime terminates. Any coroutine has its own lifetime, and in most cases you don't need to use this overload with lifetime. The exception is if you use this method to get a bindable result, then you should pass a special lifetime.

request
responseScheduler

scheduler, which will be used to set the value of the result. The default is to use the scheduler created from the current kotlin.coroutines.CoroutineContext if the current IRdCall is marked async, otherwise the protocol scheduler is used.


open suspend fun startSuspending(request: TReq, responseScheduler: IScheduler? = null): TRes

The same as startSuspending, but the lifetime is equivalent to the lifetime of the current coroutine. Asynchronously invokes the API with the parameters given as request and waits for the result suspending. If you use this method to get a bindable result, then it will be bound to the current IRdCall`s lifetime. If you want to bind the result to a different lifetime, you should use a startSuspending method with lifetime

Parameters

request
responseScheduler

scheduler, which will be used to set the value of the result. The default is to use the scheduler created from the current kotlin.coroutines.CoroutineContext if the current IRdCall is marked async, otherwise the protocol scheduler is used.