| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431 | <!DOCTYPE html><!--[if IE]><![endif]--><html>    <head>    <meta charset="utf-8">    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">    <title>Class AsyncUnaryCall<TResponse>   | gRPC C# </title>    <meta name="viewport" content="width=device-width">    <meta name="title" content="Class AsyncUnaryCall<TResponse>   | 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.AsyncUnaryCall`1">      <h1 id="Grpc_Core_AsyncUnaryCall_1" data-uid="Grpc.Core.AsyncUnaryCall`1" class="text-break">Class AsyncUnaryCall<TResponse>  </h1>  <div class="markdown level0 summary"><p>Return type for single request - single response call.</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">AsyncUnaryCall<TResponse></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.Api.dll</h6>  <h5 id="Grpc_Core_AsyncUnaryCall_1_syntax">Syntax</h5>  <div class="codewrapper">    <pre><code class="lang-csharp hljs">public sealed class AsyncUnaryCall<TResponse> : 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">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_AsyncUnaryCall_1__ctor_" data-uid="Grpc.Core.AsyncUnaryCall`1.#ctor*"></a>  <h4 id="Grpc_Core_AsyncUnaryCall_1__ctor_System_Threading_Tasks_Task__0__System_Func_System_Object_System_Threading_Tasks_Task_Grpc_Core_Metadata___System_Func_System_Object_Grpc_Core_Status__System_Func_System_Object_Grpc_Core_Metadata__System_Action_System_Object__System_Object_" data-uid="Grpc.Core.AsyncUnaryCall`1.#ctor(System.Threading.Tasks.Task{`0},System.Func{System.Object,System.Threading.Tasks.Task{Grpc.Core.Metadata}},System.Func{System.Object,Grpc.Core.Status},System.Func{System.Object,Grpc.Core.Metadata},System.Action{System.Object},System.Object)">AsyncUnaryCall(Task<TResponse>, Func<Object, Task<Metadata>>, Func<Object, Status>, Func<Object, Metadata>, Action<Object>, Object)</h4>  <div class="markdown level1 summary"><p>Creates a new AsyncUnaryCall 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 AsyncUnaryCall(Task<TResponse> responseAsync, Func<object, Task<Metadata>> responseHeadersAsync, Func<object, Status> getStatusFunc, Func<object, Metadata> getTrailersFunc, Action<object> disposeAction, object state)</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><span class="xref">System.Threading.Tasks.Task</span><TResponse></td>        <td><span class="parametername">responseAsync</span></td>        <td><p>The response of the asynchronous call.</p></td>      </tr>      <tr>        <td><span class="xref">System.Func</span><<span class="xref">System.Object</span>, <span class="xref">System.Threading.Tasks.Task</span><<a class="xref" href="Grpc.Core.Metadata.html">Metadata</a>>></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><<span class="xref">System.Object</span>, <a class="xref" href="Grpc.Core.Status.html">Status</a>></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><<span class="xref">System.Object</span>, <a class="xref" href="Grpc.Core.Metadata.html">Metadata</a>></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><<span class="xref">System.Object</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>      <tr>        <td><span class="xref">System.Object</span></td>        <td><span class="parametername">state</span></td>        <td><p>State object for use with the callback parameters.</p></td>      </tr>    </tbody>  </table>  <a id="Grpc_Core_AsyncUnaryCall_1__ctor_" data-uid="Grpc.Core.AsyncUnaryCall`1.#ctor*"></a>  <h4 id="Grpc_Core_AsyncUnaryCall_1__ctor_System_Threading_Tasks_Task__0__System_Threading_Tasks_Task_Grpc_Core_Metadata__System_Func_Grpc_Core_Status__System_Func_Grpc_Core_Metadata__System_Action_" data-uid="Grpc.Core.AsyncUnaryCall`1.#ctor(System.Threading.Tasks.Task{`0},System.Threading.Tasks.Task{Grpc.Core.Metadata},System.Func{Grpc.Core.Status},System.Func{Grpc.Core.Metadata},System.Action)">AsyncUnaryCall(Task<TResponse>, Task<Metadata>, Func<Status>, Func<Metadata>, Action)</h4>  <div class="markdown level1 summary"><p>Creates a new AsyncUnaryCall 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 AsyncUnaryCall(Task<TResponse> responseAsync, Task<Metadata> responseHeadersAsync, Func<Status> getStatusFunc, Func<Metadata> 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><span class="xref">System.Threading.Tasks.Task</span><TResponse></td>        <td><span class="parametername">responseAsync</span></td>        <td><p>The response of the asynchronous call.</p></td>      </tr>      <tr>        <td><span class="xref">System.Threading.Tasks.Task</span><<a class="xref" href="Grpc.Core.Metadata.html">Metadata</a>></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><<a class="xref" href="Grpc.Core.Status.html">Status</a>></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><<a class="xref" href="Grpc.Core.Metadata.html">Metadata</a>></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_AsyncUnaryCall_1_ResponseAsync_" data-uid="Grpc.Core.AsyncUnaryCall`1.ResponseAsync*"></a>  <h4 id="Grpc_Core_AsyncUnaryCall_1_ResponseAsync" data-uid="Grpc.Core.AsyncUnaryCall`1.ResponseAsync">ResponseAsync</h4>  <div class="markdown level1 summary"><p>Asynchronous call result.</p></div>  <div class="markdown level1 conceptual"></div>  <h5 class="decalaration">Declaration</h5>  <div class="codewrapper">    <pre><code class="lang-csharp hljs">public Task<TResponse> ResponseAsync { 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><TResponse></td>        <td></td>      </tr>    </tbody>  </table>  <a id="Grpc_Core_AsyncUnaryCall_1_ResponseHeadersAsync_" data-uid="Grpc.Core.AsyncUnaryCall`1.ResponseHeadersAsync*"></a>  <h4 id="Grpc_Core_AsyncUnaryCall_1_ResponseHeadersAsync" data-uid="Grpc.Core.AsyncUnaryCall`1.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<Metadata> 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><<a class="xref" href="Grpc.Core.Metadata.html">Metadata</a>></td>        <td></td>      </tr>    </tbody>  </table>  <h3 id="methods">Methods  </h3>  <a id="Grpc_Core_AsyncUnaryCall_1_Dispose_" data-uid="Grpc.Core.AsyncUnaryCall`1.Dispose*"></a>  <h4 id="Grpc_Core_AsyncUnaryCall_1_Dispose" data-uid="Grpc.Core.AsyncUnaryCall`1.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 call result has been received), doesn'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_AsyncUnaryCall_1_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"Cancel" semantics of invoking <code>Dispose</code>.</p></div>  <a id="Grpc_Core_AsyncUnaryCall_1_GetAwaiter_" data-uid="Grpc.Core.AsyncUnaryCall`1.GetAwaiter*"></a>  <h4 id="Grpc_Core_AsyncUnaryCall_1_GetAwaiter" data-uid="Grpc.Core.AsyncUnaryCall`1.GetAwaiter">GetAwaiter()</h4>  <div class="markdown level1 summary"><p>Allows awaiting this object directly.</p></div>  <div class="markdown level1 conceptual"></div>  <h5 class="decalaration">Declaration</h5>  <div class="codewrapper">    <pre><code class="lang-csharp hljs">public TaskAwaiter<TResponse> GetAwaiter()</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><span class="xref">System.Runtime.CompilerServices.TaskAwaiter</span><TResponse></td>        <td></td>      </tr>    </tbody>  </table>  <a id="Grpc_Core_AsyncUnaryCall_1_GetStatus_" data-uid="Grpc.Core.AsyncUnaryCall`1.GetStatus*"></a>  <h4 id="Grpc_Core_AsyncUnaryCall_1_GetStatus" data-uid="Grpc.Core.AsyncUnaryCall`1.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_AsyncUnaryCall_1_GetTrailers_" data-uid="Grpc.Core.AsyncUnaryCall`1.GetTrailers*"></a>  <h4 id="Grpc_Core_AsyncUnaryCall_1_GetTrailers" data-uid="Grpc.Core.AsyncUnaryCall`1.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>
 |