Hi Carl, 

Thanks for the reply! I have a question regarding this:

my grpc client and server are doing bi-directional streaming, in the 
StreamObserver.onNext() the client passed to server, its just print out the 
response from the server.
And on the client side, when creating the channel, I passed a 
fixedThreadPool with 5 threads. And I see from client side, the results get 
printed by 5 threads.  So that means 5 threads are accessing the same 
StreamObserver object, but as you mentioned StreamObserver is not thread 
safe?

Since the onNext() is just System.out.println(), maybe the threads do not 
access the StreamObserver concurrently. but what if the logic of process 
the response takes time, and when thread1 hasn't finished with its onNext() 
call, the next response arrives, and another thread trying to process it, 
is there any consequence of this scenario?

Thanks a lot!

On Thursday, August 23, 2018 at 2:38:07 PM UTC-7, Carl Mastrangelo wrote:
>
> You can see the change here: 
> https://github.com/grpc/grpc-java/commit/defb955f3ab233e11d960a42495ca955306d57a4
>   
> .  StreamObserver wraps a ClientCall.
> On Thursday, August 23, 2018 at 1:09:55 PM UTC-7, eleano...@gmail.com 
> wrote:
>>
>> Hi Carl, 
>>
>> what about StreamObserver thread safety? can you please point to me the 
>> documentation if it exists?
>>
>> Thanks a lot!
>>
>> On Tuesday, July 31, 2018 at 11:18:59 AM UTC-7, Carl Mastrangelo wrote:
>>>
>>> Notice: This is expected to be the last version supporting Java 6. 
>>> Comment on #3961 <https://github.com/grpc/grpc-java/issues/3961> if 
>>> this causes you trouble. Android API level 14 support will be unchanged.
>>> Dependencies
>>>    
>>>    - Updated to Netty 4.1.27 and Netty TCNative 2.0.12
>>>    - gRPC is now regularly tested with JDK 9 and 10
>>>
>>> API Changes
>>>    
>>>    - OkHttpChannelBuilder#negotiationType is now deprecated
>>>    - Made protobuf, protobuf-lite, and protobuf-nano classes final.
>>>
>>> New Features
>>>    
>>>    - Channel Tracing now record State Changes
>>>    - Stubs now have an RpcMethod annotation for use with annotation 
>>>    processors
>>>    - Added support for providing List<EquivalentAddressGroup> to 
>>>    LoadBalancer Subchannels, in addition to the option of providing a 
>>>    EquivalentAddressGroup (EAG). This prevents the need for LoadBalancers 
>>>    to "flatten" a List<EquivalentAddressGroup> into a single 
>>>    EquivalentAddressGroup which loses/confuses the EAG's Attributes. 
>>>    NameResolvers can now specify Attributes in an EAG and expect that 
>>>    the values are passed to gRPC's core. Future work will add List<EAG>
>>>     for OobChannels.
>>>    - InProcessSocketAddress now has a useful toString() method
>>>    - AndroidChannelBuilder is now easier to build
>>>    - RoundRobinLoadBalancer now scales better when using stickiness
>>>
>>> Behavior Changes
>>>    
>>>    - gRPCLB no longer depends on having a Service Config
>>>
>>> Bug Fixes
>>>    
>>>    - Fix regression that broke Java 9 ALPN support. This fixes the 
>>>    error "SunJSSE selected, but Jetty NPN/ALPN unavailable" (#4620 
>>>    <https://github.com/grpc/grpc-java/issues/4620>)
>>>    - Fixed a bug with gRPC LB parsing SRV DNS records ( 6dbe392 
>>>    
>>> <https://github.com/grpc/grpc-java/commit/6dbe3921edd09553b5d87cc39eef485cb004d245>
>>>     )
>>>    - enterIdle() will exit idle mode if channel is still in use (#4665 
>>>    <https://github.com/grpc/grpc-java/pull/4665>)
>>>    - TransmitStatusRuntimeExceptionInterceptor now avoids accidentally 
>>>    double closing the call.
>>>
>>> Documentation
>>>    
>>>    - Clarified StreamObserver interaction with thread safety
>>>
>>> Thanks to all our Contributors:
>>>
>>>    - @DmPanov <https://github.com/DmPanov>
>>>    - @groakley <https://github.com/groakley> - Grant Oakley
>>>    - @jbingham-google <https://github.com/jbingham-google> - Jonathan 
>>>    Bingham
>>>    - @jyane <https://github.com/jyane> - Shohei Kamimori
>>>    - @kay <https://github.com/kay> - Doug Lawrie
>>>    - @marcoferrer <https://github.com/marcoferrer> - Marco Ferrer
>>>    - @njhill <https://github.com/njhill> - Nick Hill
>>>    - @PunKeel <https://github.com/PunKeel> - Maxime Guerreiro
>>>    - @songya <https://github.com/songya> - Yang Song
>>>    - @sullis <https://github.com/sullis>
>>>    - @werkt <https://github.com/werkt> - George Gensure
>>>
>>>
>>>
>>> See https://github.com/grpc/grpc-java/releases/tag/v1.14.0 
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/526c6862-e948-4a81-81d1-e44e39cbefaf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to