rd-framework / com.jetbrains.rd.framework.impl / RdCall

RdCall

class RdCall<TReq, TRes> : RdReactiveBase, IRdCall<TReq, TRes>, IRdEndpoint<TReq, TRes>

Types

Companion

companion object Companion : ISerializer<RdCall<*, *>>

Constructors

<init>

RdCall(cancellationScheduler: <ERROR CLASS>? = null, handlerScheduler: <ERROR CLASS>? = null, handler: (<ERROR CLASS>, TReq) -> RdTask<TRes>)
RdCall(requestSzr: ISerializer<TReq> = Polymorphic<TReq>(), responseSzr: ISerializer<TRes> = Polymorphic<TRes>())RdCall(cancellationScheduler: <ERROR CLASS>? = null, handlerScheduler: <ERROR CLASS>? = null, handler: (TReq) -> TRes)

Assigns a handler that executes the API synchronously.

Properties

bindLifetime

lateinit var bindLifetime: <ERROR CLASS>

serializationContext

lateinit var serializationContext: SerializationCtx

wireScheduler

val wireScheduler: <ERROR CLASS>

Scheduler on which wire invokes callback onWireReceived. Default is the same as protocol's one.

Inherited Properties

async

open var async: Boolean

If set to true, local changes to this object can be performed on any thread. Otherwise, local changes can be performed only on the UI thread.

defaultScheduler

val defaultScheduler: <ERROR CLASS>

isLocalChange

var isLocalChange: Boolean

master

var master: Boolean

serializers

val serializers: ISerializers

wire

val wire: IWire

Functions

deepClone

fun deepClone(): IRdBindable

init

fun init(lifetime: <ERROR CLASS>): Unit

onWireReceived

fun onWireReceived(buffer: AbstractBuffer): Unit

Callback that wire triggers when it receives messaged

set

fun set(cancellationScheduler: <ERROR CLASS>?, handlerScheduler: <ERROR CLASS>?, handler: (<ERROR CLASS>, TReq) -> RdTask<TRes>): Unit

Assigns a handler that executes the API asynchronously.

start

fun start(request: TReq, responseScheduler: <ERROR CLASS>?): IRdTask<TRes>

Asynchronously invokes the API with the parameters given as request and waits for the result. The returned task will have its result value assigned through the given responseScheduler.

fun start(request: TReq): <ERROR CLASS>
fun start(lifetime: <ERROR CLASS>, request: TReq): IRdTask<TRes>
fun start(lifetime: <ERROR CLASS>, request: TReq, responseScheduler: <ERROR CLASS>?): IRdTask<TRes>

startSuspending

suspend fun startSuspending(lifetime: <ERROR CLASS>, request: TReq, responseScheduler: <ERROR CLASS>?): TRes

sync

fun sync(request: TReq, timeouts: RpcTimeouts?): TRes

Invokes the API with the parameters given as request and waits for the result.

Inherited Functions

assertBound

fun assertBound(): Unit

assertThreading

fun assertThreading(): Unit

set

abstract fun set(cancellationScheduler: <ERROR CLASS>? = null, handlerScheduler: <ERROR CLASS>? = null, handler: (<ERROR CLASS>, TReq) -> RdTask<TRes>): Unit

Assigns a handler that executes the API asynchronously.

open fun set(cancellationScheduler: <ERROR CLASS>? = null, handlerScheduler: <ERROR CLASS>? = null, handler: (TReq) -> TRes): Unit

Assigns a handler that executes the API synchronously.

Companion Object Properties

respectSyncCallTimeouts

var respectSyncCallTimeouts: Boolean

Companion Object Functions

read

fun read(ctx: SerializationCtx, buffer: AbstractBuffer): RdCall<*, *>
fun <TReq, TRes> read(ctx: SerializationCtx, buffer: AbstractBuffer, requestSzr: ISerializer<TReq>, responseSzr: ISerializer<TRes>): RdCall<TReq, TRes>

write

fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: RdCall<*, *>): Unit

Extension Functions

bind

fun <T : IRdBindable?> T.bind(lf: <ERROR CLASS>, parent: IRdDynamic, name: String): Unit?

deepClonePolymorphic

fun <T> T.deepClonePolymorphic(): T

identify

fun <T : IRdBindable?> T.identify(identities: IIdentities, ids: RdId): Unit?

setSuspend

fun <TReq, TRes> IRdEndpoint<TReq, TRes>.setSuspend(cancellationScheduler: <ERROR CLASS>? = null, handlerScheduler: <ERROR CLASS>? = null, handler: suspend (<ERROR CLASS>, TReq) -> TRes): Unit

startAndAdviseSuccess

fun <TReq, TRes> IRdCall<TReq, TRes>.startAndAdviseSuccess(request: TReq, onSuccess: (TRes) -> Unit): Unit
fun <TReq, TRes> IRdCall<TReq, TRes>.startAndAdviseSuccess(lifetime: <ERROR CLASS>, request: TReq, onSuccess: (TRes) -> Unit): Unit

static

fun <T : RdBindableBase> T.static(id: Int): T

withId

fun <T : RdBindableBase> T.withId(id: RdId): T

withIdFromName

fun <T : RdBindableBase> T.withIdFromName(name: String): T