@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/4694")
public final class StreamObservers
extends java.lang.Object
StreamObserver and it's common subclasses like
CallStreamObserver.| Constructor and Description |
|---|
StreamObservers() |
| Modifier and Type | Method and Description |
|---|---|
static <V> void |
copyWithFlowControl(java.lang.Iterable<V> source,
CallStreamObserver<V> target)
Copy the values of an
Iterable to the target CallStreamObserver while properly
accounting for outbound flow-control. |
static <V> void |
copyWithFlowControl(java.util.Iterator<V> source,
CallStreamObserver<V> target)
Copy the values of an
Iterator to the target CallStreamObserver while properly
accounting for outbound flow-control. |
public static <V> void copyWithFlowControl(java.util.Iterator<V> source,
CallStreamObserver<V> target)
Iterator to the target CallStreamObserver while properly
accounting for outbound flow-control. After calling this method, target should no
longer be used.
For clients this method is safe to call inside ClientResponseObserver.beforeStart(io.grpc.stub.ClientCallStreamObserver<ReqT>),
on servers it is safe to call inside the service method implementation.
source - of values expressed as an Iterator.target - CallStreamObserver which accepts values from the source.public static <V> void copyWithFlowControl(java.lang.Iterable<V> source,
CallStreamObserver<V> target)
Iterable to the target CallStreamObserver while properly
accounting for outbound flow-control. After calling this method, target should no
longer be used.
For clients this method is safe to call inside ClientResponseObserver.beforeStart(io.grpc.stub.ClientCallStreamObserver<ReqT>),
on servers it is safe to call inside the service method implementation.
source - of values expressed as an Iterable.target - CallStreamObserver which accepts values from the source.