CurrentRpcCallElement

Coroutine-context element describing the RPC call currently being handled by a ksrpc dispatcher. Installed at the single chokepoint where the user's handler body is invoked (RpcMethod.call) so that the handler can introspect its own call identity (for correlating progress notifications, streaming side-channels, etc.) via currentRpcCall.

Because the element is (re)installed at each handler invocation, nested outbound calls naturally see a fresh element installed at the destination's RpcMethod.call — no caller-side stripping is required.

Constructors

Link copied to clipboard
constructor(method: RpcMethod<*, *, *>, id: RpcCallId?)

Properties

Link copied to clipboard

Transport-specific identifier for this call, or null for calls with no id on the wire (e.g. a JSON-RPC notification) and for in-process handler invocations that bypass a transport.

Link copied to clipboard
open override val key: CoroutineContext.Key<*>
Link copied to clipboard
val method: RpcMethod<*, *, *>

The RpcMethod being handled. Handlers can read its RpcMethod.endpoint, RpcMethod.metadata, etc. Not nullable — the element is only installed when a concrete method is being dispatched.

Functions

Link copied to clipboard
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Link copied to clipboard
open operator fun plus(context: CoroutineContext): CoroutineContext
Link copied to clipboard
open override fun toString(): String