Skip to content

Commit 00860a7

Browse files
committed
update readme
1 parent 8f16f7e commit 00860a7

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
@@ -17,7 +17,7 @@ cd kotlin-coroutines-gRPC-template && \
1717
./gradlew run
1818
```
1919

20-
## Version 0.2.2-RC2
20+
## Version 0.2.2-RC3
2121
* [CHANGELOG](https://github.com/marcoferrer/kroto-plus/blob/master/CHANGELOG.md)
2222
* Most notable changes
2323
* Full Client & Server Stub Generation 🎉
@@ -87,13 +87,16 @@ __Addtional Docs Coming Soon__
8787
* Design
8888
* **Back pressure** is supported via [Manual Flow Control](https://github.com/grpc/grpc-java/tree/master/examples/src/main/java/io/grpc/examples/manualflowcontrol)
8989
* 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.
9191
<a></a>
9292
* Client Stubs
9393
* Implement ```CoroutineScope``` interface
9494
* Designed to work well with **Structured Concurrency**
95+
* Cancellation of the client `CoroutineScope` will propagate to the server.
9596
* Cancellations can now be propagated across usages of a specific stub instance.
9697
* Rpc methods are overloaded with inline builders for request types
98+
* The request parameter for rpc methods defaults to `RequestType.defaultsInstance`
99+
97100
98101
```kotlin
99102
val stub = GreeterCoroutineGrpc.newStub(channel)
@@ -106,10 +109,9 @@ stub.sayHello { name = "John" }
106109
* Rpc calls are wrapped within a scope initialized with the following context elements.
107110
* ```CoroutineName``` set to ```MethodDescriptor.fullMethodName```
108111
* ```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(...)```
113115

114116
#### Examples
115117
* [Unary](https://github.com/marcoferrer/kroto-plus#unary)
@@ -124,7 +126,7 @@ val response = stub.sayHello { name = "John" }
124126
```
125127
_Server_
126128
```kotlin
127-
override suspend fun sayHello(request: HelloRequest): HelloReply = coroutineScope {
129+
override suspend fun sayHello(request: HelloRequest): HelloReply {
128130

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

0 commit comments

Comments
 (0)