You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Back pressure** is supported via [Manual Flow Control](https://github.com/grpc/grpc-java/tree/master/examples/src/main/java/io/grpc/examples/manualflowcontrol)
89
89
* Related Reading: [Understanding Reactive gRPC Flow Control](https://github.com/salesforce/reactive-grpc#back-pressure)
90
-
***Cooperative cancellation**is propagated across network boundaries. Meaning a cancelled client ```coroutineContext``` attached to a stub will cancel the related rpc job within the service impl.
90
+
***Cooperative cancellation** across network boundaries.
91
91
<a></a>
92
92
* Client Stubs
93
93
* Implement ```CoroutineScope``` interface
94
94
* Designed to work well with **Structured Concurrency**
95
+
* Cancellation of the client `CoroutineScope` will propagate to the server.
95
96
* Cancellations can now be propagated across usages of a specific stub instance.
96
97
* Rpc methods are overloaded with inline builders for request types
98
+
* The request parameter for rpc methods defaults to `RequestType.defaultsInstance`
99
+
97
100
98
101
```kotlin
99
102
val stub =GreeterCoroutineGrpc.newStub(channel)
@@ -106,10 +109,9 @@ stub.sayHello { name = "John" }
106
109
* Rpc calls are wrapped within a scope initialized with the following context elements.
107
110
*```CoroutineName``` set to ```MethodDescriptor.fullMethodName```
108
111
*```GrpcContextElement``` set to ```io.grpc.Context.current()```
109
-
* Base services implement ```CoroutineScope``` only as a means to allow overriding the initial ```coroutineContext```
110
-
* The initial ```coroutineContext``` defaults to ```EmptyCoroutineContext```
111
-
* A common case for overriding the default context is for setting up application specific ```ThreadContextElement``` or ```CoroutineDispatcher```, such as ```MDCContext()``` or ```newFixedThreadPoolContext(...)```
112
-
* Rpc method implementation **MUST** be wrapped in a ```coroutineScope{}``` builder. Future versions of Kotlin will show a warning in the ide for ambiguous scope resolution. [KT-27493](https://youtrack.jetbrains.com/issue/KT-27493). It also ensures that the proper ```coroutineContext``` is used during method execution.
112
+
* Base services implement ```ServiceScope``` and allow overriding the initial ```coroutineContext``` used for each rpc method invocation.
113
+
* Each services ```initialContext``` defaults to ```EmptyCoroutineContext```
114
+
* A common case for overriding the ```initialContext``` is for setting up application specific ```ThreadContextElement``` or ```CoroutineDispatcher```, such as ```MDCContext()``` or ```newFixedThreadPoolContext(...)```
0 commit comments