public FlightRecordBatchDuplexStreamingCall StartPut(FlightDescriptor flightDescriptor, Metadata headers = null) { var channels = _client.DoPut(headers); var requestStream = new FlightClientRecordBatchStreamWriter(channels.RequestStream, flightDescriptor); var readStream = new StreamReader <Protocol.PutResult, FlightPutResult>(channels.ResponseStream, putResult => new FlightPutResult(putResult)); return(new FlightRecordBatchDuplexStreamingCall( requestStream, readStream, channels.ResponseHeadersAsync, channels.GetStatus, channels.GetTrailers, channels.Dispose)); }
internal FlightRecordBatchDuplexStreamingCall( FlightClientRecordBatchStreamWriter requestStream, IAsyncStreamReader <FlightPutResult> responseStream, Task <Metadata> responseHeadersAsync, Func <Status> getStatusFunc, Func <Metadata> getTrailersFunc, Action disposeAction) { RequestStream = requestStream; ResponseStream = responseStream; ResponseHeadersAsync = responseHeadersAsync; _getStatusFunc = getStatusFunc; _getTrailersFunc = getTrailersFunc; _disposeAction = disposeAction; }