Skip to content

Commit 5951b63

Browse files
committed
Refactor.
1 parent 63ad232 commit 5951b63

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stub/src/main/java/io/grpc/kotlin/MetadataCoroutineContextInterceptor.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import kotlin.coroutines.CoroutineContext
66

77
/**
88
* Propagates gRPC Metadata (HTTP Headers) to coroutineContext.
9-
* Attach the interceptor to gRPC Server and then access the Metadata using extractMetadata() function.
9+
* Attach the interceptor to gRPC Server and then access the Metadata using grpcMetadata() function.
10+
*
1011
* Example usage:
1112
*
1213
* ServerBuilder.forPort(8060)
1314
* .addService(GreeterImpl())
1415
* .intercept(MetadataCoroutineContextInterceptor())
1516
*
16-
* extractMetadata()
17+
* grpcMetadata()
1718
*/
1819
class MetadataCoroutineContextInterceptor : CoroutineContextServerInterceptor() {
1920
final override fun coroutineContext(call: ServerCall<*, *>, headers: Metadata): CoroutineContext {
@@ -22,7 +23,7 @@ class MetadataCoroutineContextInterceptor : CoroutineContextServerInterceptor()
2223
}
2324

2425
/**
25-
* Used for accessing the Metadata from coroutineContext.
26+
* Used for accessing the gRPC Metadata from coroutineContext.
2627
* Example usage:
2728
* coroutineContext[MetadataElement]?.value
2829
*/

0 commit comments

Comments
 (0)