grpc/csharp/api/Grpc.Core.AsyncDuplexStream...

386 lines
16 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class AsyncDuplexStreamingCall&lt;TRequest, TResponse&gt;
| gRPC C# </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class AsyncDuplexStreamingCall&lt;TRequest, TResponse&gt;
| gRPC C# ">
<meta name="generator" content="docfx 2.36.0.0">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list"></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2">
<h1 id="Grpc_Core_AsyncDuplexStreamingCall_2" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2" class="text-break">Class AsyncDuplexStreamingCall&lt;TRequest, TResponse&gt;
</h1>
<div class="markdown level0 summary"><p>Return type for bidirectional streaming calls.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">AsyncDuplexStreamingCall&lt;TRequest, TResponse&gt;</span></div>
</div>
<div classs="implements">
<h5>Implements</h5>
<div><span class="xref">System.IDisposable</span></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.Object.Equals(System.Object)</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.GetHashCode()</span>
</div>
<div>
<span class="xref">System.Object.GetType()</span>
</div>
<div>
<span class="xref">System.Object.MemberwiseClone()</span>
</div>
<div>
<span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.ToString()</span>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Core.html">Grpc.Core</a></h6>
<h6><strong>Assembly</strong>: Grpc.Core.dll</h6>
<h5 id="Grpc_Core_AsyncDuplexStreamingCall_2_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public sealed class AsyncDuplexStreamingCall&lt;TRequest, TResponse&gt; : IDisposable</code></pre>
</div>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">TRequest</span></td>
<td><p>Request message type for this call.</p>
</td>
</tr>
<tr>
<td><span class="parametername">TResponse</span></td>
<td><p>Response message type for this call.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="constructors">Constructors
</h3>
<a id="Grpc_Core_AsyncDuplexStreamingCall_2__ctor_" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.#ctor*"></a>
<h4 id="Grpc_Core_AsyncDuplexStreamingCall_2__ctor_Grpc_Core_IClientStreamWriter__0__Grpc_Core_IAsyncStreamReader__1__System_Threading_Tasks_Task_Grpc_Core_Metadata__System_Func_Grpc_Core_Status__System_Func_Grpc_Core_Metadata__System_Action_" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.#ctor(Grpc.Core.IClientStreamWriter{`0},Grpc.Core.IAsyncStreamReader{`1},System.Threading.Tasks.Task{Grpc.Core.Metadata},System.Func{Grpc.Core.Status},System.Func{Grpc.Core.Metadata},System.Action)">AsyncDuplexStreamingCall(IClientStreamWriter&lt;TRequest&gt;, IAsyncStreamReader&lt;TResponse&gt;, Task&lt;Metadata&gt;, Func&lt;Status&gt;, Func&lt;Metadata&gt;, Action)</h4>
<div class="markdown level1 summary"><p>Creates a new AsyncDuplexStreamingCall object with the specified properties.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public AsyncDuplexStreamingCall(IClientStreamWriter&lt;TRequest&gt; requestStream, IAsyncStreamReader&lt;TResponse&gt; responseStream, Task&lt;Metadata&gt; responseHeadersAsync, Func&lt;Status&gt; getStatusFunc, Func&lt;Metadata&gt; getTrailersFunc, Action disposeAction)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Grpc.Core.IClientStreamWriter-1.html">IClientStreamWriter</a>&lt;TRequest&gt;</td>
<td><span class="parametername">requestStream</span></td>
<td><p>Stream of request values.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="Grpc.Core.IAsyncStreamReader-1.html">IAsyncStreamReader</a>&lt;TResponse&gt;</td>
<td><span class="parametername">responseStream</span></td>
<td><p>Stream of response values.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Threading.Tasks.Task</span>&lt;<a class="xref" href="Grpc.Core.Metadata.html">Metadata</a>&gt;</td>
<td><span class="parametername">responseHeadersAsync</span></td>
<td><p>Response headers of the asynchronous call.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Func</span>&lt;<a class="xref" href="Grpc.Core.Status.html">Status</a>&gt;</td>
<td><span class="parametername">getStatusFunc</span></td>
<td><p>Delegate returning the status of the call.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Func</span>&lt;<a class="xref" href="Grpc.Core.Metadata.html">Metadata</a>&gt;</td>
<td><span class="parametername">getTrailersFunc</span></td>
<td><p>Delegate returning the trailing metadata of the call.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Action</span></td>
<td><span class="parametername">disposeAction</span></td>
<td><p>Delegate to invoke when Dispose is called on the call object.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="properties">Properties
</h3>
<a id="Grpc_Core_AsyncDuplexStreamingCall_2_RequestStream_" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.RequestStream*"></a>
<h4 id="Grpc_Core_AsyncDuplexStreamingCall_2_RequestStream" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.RequestStream">RequestStream</h4>
<div class="markdown level1 summary"><p>Async stream to send streaming requests.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IClientStreamWriter&lt;TRequest&gt; RequestStream { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Grpc.Core.IClientStreamWriter-1.html">IClientStreamWriter</a>&lt;TRequest&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<a id="Grpc_Core_AsyncDuplexStreamingCall_2_ResponseHeadersAsync_" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.ResponseHeadersAsync*"></a>
<h4 id="Grpc_Core_AsyncDuplexStreamingCall_2_ResponseHeadersAsync" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.ResponseHeadersAsync">ResponseHeadersAsync</h4>
<div class="markdown level1 summary"><p>Asynchronous access to response headers.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Task&lt;Metadata&gt; ResponseHeadersAsync { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Threading.Tasks.Task</span>&lt;<a class="xref" href="Grpc.Core.Metadata.html">Metadata</a>&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<a id="Grpc_Core_AsyncDuplexStreamingCall_2_ResponseStream_" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.ResponseStream*"></a>
<h4 id="Grpc_Core_AsyncDuplexStreamingCall_2_ResponseStream" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.ResponseStream">ResponseStream</h4>
<div class="markdown level1 summary"><p>Async stream to read streaming responses.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IAsyncStreamReader&lt;TResponse&gt; ResponseStream { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Grpc.Core.IAsyncStreamReader-1.html">IAsyncStreamReader</a>&lt;TResponse&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<a id="Grpc_Core_AsyncDuplexStreamingCall_2_Dispose_" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.Dispose*"></a>
<h4 id="Grpc_Core_AsyncDuplexStreamingCall_2_Dispose" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.Dispose">Dispose()</h4>
<div class="markdown level1 summary"><p>Provides means to cleanup after the call.
If the call has already finished normally (request stream has been completed and response stream has been fully read), doesn&apos;t do anything.
Otherwise, requests cancellation of the call which should terminate all pending async operations associated with the call.
As a result, all resources being used by the call should be released eventually.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
</div>
<h5 id="Grpc_Core_AsyncDuplexStreamingCall_2_Dispose_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Normally, there is no need for you to dispose the call unless you want to utilize the
&quot;Cancel&quot; semantics of invoking <code>Dispose</code>.</p>
</div>
<a id="Grpc_Core_AsyncDuplexStreamingCall_2_GetStatus_" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.GetStatus*"></a>
<h4 id="Grpc_Core_AsyncDuplexStreamingCall_2_GetStatus" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.GetStatus">GetStatus()</h4>
<div class="markdown level1 summary"><p>Gets the call status if the call has already finished.
Throws InvalidOperationException otherwise.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Status GetStatus()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Grpc.Core.Status.html">Status</a></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Grpc_Core_AsyncDuplexStreamingCall_2_GetTrailers_" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.GetTrailers*"></a>
<h4 id="Grpc_Core_AsyncDuplexStreamingCall_2_GetTrailers" data-uid="Grpc.Core.AsyncDuplexStreamingCall`2.GetTrailers">GetTrailers()</h4>
<div class="markdown level1 summary"><p>Gets the call trailing metadata if the call has already finished.
Throws InvalidOperationException otherwise.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Metadata GetTrailers()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Grpc.Core.Metadata.html">Metadata</a></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="implements">Implements</h3>
<div>
<span class="xref">System.IDisposable</span>
</div>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>