close

Available in a dev version: 0․11․0-grpc-186

How to configure

abstract fun close(status: GrpcStatus, trailers: GrpcMetadata = GrpcMetadata()): Nothing(source)

Immediately terminate the call with the given status and optional trailers.

This method does not return (declared as Nothing). After calling it, no further messages will be processed or sent. Prefer setting responseHeaders/responseTrailers before closing if you need to include metadata.

We made close throw a kotlinx.rpc.grpc.GrpcStatusException instead of returning, so control flow is explicit and race conditions between interceptors and the service implementation are avoided.