Method

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

How to configure

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Method(val name: String = "", val safe: Boolean = false, val idempotent: Boolean = false, val sampledToLocalTracing: Boolean = true)(source)

Configures gRPC-specific metadata for a service method.

This annotation allows fine-grained control over method behavior and characteristics that affect how the gRPC method is handled by servers and clients.

See also

Properties

Link copied to clipboard
val idempotent: Boolean = false

Indicates whether the method is idempotent (multiple identical requests have the same effect as a single request). Idempotent methods can be safely retried. Default is false.

Link copied to clipboard

Custom name for the gRPC method. If empty (default), the Kotlin function name is used.

Link copied to clipboard
val safe: Boolean = false

Indicates whether the method is safe (has no side effects). Safe methods can be cached or retried without concern. Default is false.

Link copied to clipboard

Controls whether RPCs for this method may be sampled into the local tracing store.