From 182e95156fb4b84f69466bd79c32e71386f56b80 Mon Sep 17 00:00:00 2001 From: ryosuke-hasebe Date: Mon, 29 May 2023 14:58:05 +0900 Subject: [PATCH] Open CoroutineContextServerInterceptor.COROUTINE_CONTEXT_KEY --- .../java/io/grpc/kotlin/CoroutineContextServerInterceptor.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stub/src/main/java/io/grpc/kotlin/CoroutineContextServerInterceptor.kt b/stub/src/main/java/io/grpc/kotlin/CoroutineContextServerInterceptor.kt index f81063eb..79c79ef9 100644 --- a/stub/src/main/java/io/grpc/kotlin/CoroutineContextServerInterceptor.kt +++ b/stub/src/main/java/io/grpc/kotlin/CoroutineContextServerInterceptor.kt @@ -16,9 +16,7 @@ import io.grpc.Context as GrpcContext */ abstract class CoroutineContextServerInterceptor : ServerInterceptor { companion object { - // This is deliberately kept visibility-restricted; it's intentional that the only way to affect - // the CoroutineContext is to extend CoroutineContextServerInterceptor. - internal val COROUTINE_CONTEXT_KEY : GrpcContext.Key = + val COROUTINE_CONTEXT_KEY : GrpcContext.Key = GrpcContext.keyWithDefault("grpc-kotlin-coroutine-context", EmptyCoroutineContext) private fun GrpcContext.extendCoroutineContext(coroutineContext: CoroutineContext): GrpcContext {