bidiStreamingRpc

fun <RequestT, ResponseT> bidiStreamingRpc(channel: Channel, method: MethodDescriptor<RequestT, ResponseT>, requests: Flow<RequestT>, callOptions: CallOptions = CallOptions.DEFAULT, headers: Metadata = GrpcMetadata()): Flow<ResponseT>(source)

Returns a Flow which launches the specified bidirectional-streaming RPC, collecting the requests flow, sending them to the server, and emitting the responses.

Cancelling collection of the flow cancels the RPC upstream and collection of the requests. For example, if responses.take(2).toList() is executed, the RPC will be cancelled after the first two responses are returned.