@ExperimentalApi public class StreamObservers extends Object
StreamObserver
and it's common subclasses like
CallStreamObserver
.Constructor and Description |
---|
StreamObservers() |
Modifier and Type | Method and Description |
---|---|
static <V> void |
copyWithFlowControl(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(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(Iterator<V> source, CallStreamObserver<V> target)
Iterator
to the target CallStreamObserver
while properly
accounting for outbound flow-control.
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(Iterable<V> source, CallStreamObserver<V> target)
Iterable
to the target CallStreamObserver
while properly
accounting for outbound flow-control.
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.