Are
StreamObservers thread-safe? In particular, can
onNext be called concurrently on a single
StreamObserver from multiple threads?
The docs say
Implementations are expected to be thread-compatible. Separate StreamObservers do not need to be sychronized (SIC) together; incoming and outgoing directions are independent.
It's unclear (to me, anyway) what thread-compatible means, if it's only meant to apply between the StreamObservers for a single RPC.
I'm getting an NPE io.grpc.internal.ServerCallImpl.sendHeaders, possibly because I have multiple threads writing to the same observer. It's easy enough to synchronize and that appears to solve the problem, I just want to make sure it's the right thing to do ...