Document CallStreamObserver.request() thread-safety
See original GitHub issueWhat version of gRPC are you using?
1.5.0
The javadoc for CallStreamObserver.request()
makes no statement about thread safety. I see that the applicable implementations call request()
methods that are documented as thread-safe, and that CallStreamObserver.request()
is called as if it were thread-safe. I assume that this is meant to be a contract, as otherwise usage would be oddly complicated.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
StreamObserver (grpc-all 1.51.0 API)
Receives notifications from an observable stream of messages. It is used by both the client stubs and service implementations for sending or receiving ......
Read more >ServerCallStreamObserver (grpc-stub 1.22.1 API) - javadoc.io
A refinement of CallStreamObserver to allows for interaction with call ... Like StreamObserver , implementations are not required to be thread-safe; ...
Read more >Can gRPC Java client send multiple requests in parallel over ...
when sending messages, you should respect other side's readiness using methods from CallStreamObserver: isReady() and setOnReadyHandler(...) (you can always ...
Read more >Effective Java: Document Thread Safety | by Kyle Carter | CodeX
synchronized wrappers that synchronize much of interactions with the object but do require external synchronization of iterators returned. Not ...
Read more >io.grpc.stub.CallStreamObserver java code examples - Tabnine
BlockingStreamObserver(CallStreamObserver<T> delegate) { this.delegate = delegate; final Runnable notifyAll = () -> { synchronized (lock) { lock.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To be useful,
request()
must be thread-safe. Yes, we need to update the documentation.ClientCall
specifies forrequest()
:We should include something similar in
CallStreamObserver
.Correct. They are not thread-safe.
We should probably just copy the same “Implementations are expected to be thread-compatible” doc to
CallStreamObserver
(and children). Then we just call out inrequest()
's documentation that it is thread-safe. Same approach as inClientCall
.