NPRPC docs

class NPRPCDeferredCall

Swift

final class NPRPCDeferredCall

A [coroutine] servant method on its way: generated dispatch begins one, and it sends the reply once the method returns. On a POA with a dispatch: other than .inlineOnTransportThread, the method keeps running on that executor across its awaits. A client's cancellation cancels its task.

nprpc_swift/Sources/NPRPC/Servant.swift:15

Methods

static func begin() -> NPRPCDeferredCall?

Nil if the session is at its limit; the client has been answered then.

nprpc_swift/Sources/NPRPC/Servant.swift:22

func start(_ body: @escaping @Sendable (FlatBuffer) async -> Void)

Runs the method's body with the buffer to build the reply in.

nprpc_swift/Sources/NPRPC/Servant.swift:27