Skip to content

Commit 2e7fcfa

Browse files
committed
update readme
1 parent 941bf89 commit 2e7fcfa

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ _2019-03-13_
33
* New: Update Kotlin Poet to ```1.0.1``` ([#30](https://github.com/marcoferrer/kroto-plus/pull/30))
44

55
#### Coroutines
6-
* New: Propagate client scope cancellation to server using `ClientCall.cancel` ([#34](https://github.com/marcoferrer/kroto-plus/pull/34))
6+
* New: Propagate client scope cancellation to server using `ClientCall.cancel` ([#34](https://github.com/marcoferrer/kroto-plus/pull/34))
7+
* New: Server rpc scope is now bound to cancellation notifications from the client ([#23](https://github.com/marcoferrer/kroto-plus/pull/23))
78
* Fix: Race condition between `StreamObserver.onNext` and `StreamObserver.onCompleted` when target channel is full
89
* Fix: Reduce `@KrotoPlusInternalApi` experimental level to `Experimental.Level.ERROR` to prevent external usage
910
* Fix: Remove redundant usages of `@ObsoleteCoroutinesApi` in call builders

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cd kotlin-coroutines-gRPC-template && \
1818
./gradlew run
1919
```
2020

21-
## Version 0.2.2-RC2
21+
## Version 0.2.2-RC3
2222
* [CHANGELOG](https://github.com/marcoferrer/kroto-plus/blob/master/CHANGELOG.md)
2323
* Most notable changes
2424
* Full Client & Server Stub Generation 🎉
@@ -88,13 +88,16 @@ __Addtional Docs Coming Soon__
8888
* Design
8989
* **Back pressure** is supported via [Manual Flow Control](https://github.com/grpc/grpc-java/tree/master/examples/src/main/java/io/grpc/examples/manualflowcontrol)
9090
* Related Reading: [Understanding Reactive gRPC Flow Control](https://github.com/salesforce/reactive-grpc#back-pressure)
91-
* **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.
91+
* **Cooperative cancellation** across network boundaries.
9292
<a></a>
9393
* Client Stubs
9494
* Implement ```CoroutineScope``` interface
9595
* Designed to work well with **Structured Concurrency**
96+
* Cancellation of the client `CoroutineScope` will propagate to the server.
9697
* Cancellations can now be propagated across usages of a specific stub instance.
9798
* Rpc methods are overloaded with inline builders for request types
99+
* The request parameter for rpc methods defaults to `RequestType.defaultsInstance`
100+
98101
99102
```kotlin
100103
val stub = GreeterCoroutineGrpc.newStub(channel)
@@ -107,10 +110,9 @@ stub.sayHello { name = "John" }
107110
* Rpc calls are wrapped within a scope initialized with the following context elements.
108111
* ```CoroutineName``` set to ```MethodDescriptor.fullMethodName```
109112
* ```GrpcContextElement``` set to ```io.grpc.Context.current()```
110-
* Base services implement ```CoroutineScope``` only as a means to allow overriding the initial ```coroutineContext```
111-
* The initial ```coroutineContext``` defaults to ```EmptyCoroutineContext```
112-
* A common case for overriding the default context is for setting up application specific ```ThreadContextElement``` or ```CoroutineDispatcher```, such as ```MDCContext()``` or ```newFixedThreadPoolContext(...)```
113-
* 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.
113+
* Base services implement ```ServiceScope``` and allow overriding the initial ```coroutineContext``` used for each rpc method invocation.
114+
* Each services ```initialContext``` defaults to ```EmptyCoroutineContext```
115+
* A common case for overriding the ```initialContext``` is for setting up application specific ```ThreadContextElement``` or ```CoroutineDispatcher```, such as ```MDCContext()``` or ```newFixedThreadPoolContext(...)```
114116

115117
#### Examples
116118
* [Unary](https://github.com/marcoferrer/kroto-plus#unary)
@@ -125,7 +127,7 @@ val response = stub.sayHello { name = "John" }
125127
```
126128
_Server_
127129
```kotlin
128-
override suspend fun sayHello(request: HelloRequest): HelloReply = coroutineScope {
130+
override suspend fun sayHello(request: HelloRequest): HelloReply {
129131

130132
if (isValid(request.name))
131133
HelloReply { message = "Hello there, ${request.name}!" } else

0 commit comments

Comments
 (0)