grpc/csharp/api/Grpc.Core.AsyncUnaryCall-1....

479 lines
21 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 AsyncUnaryCall&lt;TResponse&gt;
| gRPC C# </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class AsyncUnaryCall&lt;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.AsyncUnaryCall`1">
<h1 id="Grpc_Core_AsyncUnaryCall_1" data-uid="Grpc.Core.AsyncUnaryCall`1" class="text-break">Class AsyncUnaryCall&lt;TResponse&gt;
</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&lt;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.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&lt;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">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&lt;TResponse&gt;, Func&lt;Object, Task&lt;Metadata&gt;&gt;, Func&lt;Object, Status&gt;, Func&lt;Object, Metadata&gt;, Action&lt;Object&gt;, 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&lt;TResponse&gt; responseAsync, Func&lt;object, Task&lt;Metadata&gt;&gt; responseHeadersAsync, Func&lt;object, Status&gt; getStatusFunc, Func&lt;object, Metadata&gt; getTrailersFunc, Action&lt;object&gt; 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>&lt;TResponse&gt;</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>&lt;<span class="xref">System.Object</span>, <span class="xref">System.Threading.Tasks.Task</span>&lt;<a class="xref" href="Grpc.Core.Metadata.html">Metadata</a>&gt;&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;<span class="xref">System.Object</span>, <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;<span class="xref">System.Object</span>, <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>&lt;<span class="xref">System.Object</span>&gt;</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&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 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&lt;TResponse&gt; responseAsync, 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><span class="xref">System.Threading.Tasks.Task</span>&lt;TResponse&gt;</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>&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_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&lt;TResponse&gt; 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>&lt;TResponse&gt;</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&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>
<h3 id="methods">Methods
</h3>
<a id="Grpc_Core_AsyncUnaryCall_1_ConfigureAwait_" data-uid="Grpc.Core.AsyncUnaryCall`1.ConfigureAwait*"></a>
<h4 id="Grpc_Core_AsyncUnaryCall_1_ConfigureAwait_System_Boolean_" data-uid="Grpc.Core.AsyncUnaryCall`1.ConfigureAwait(System.Boolean)">ConfigureAwait(Boolean)</h4>
<div class="markdown level1 summary"><p>Configures an awaiter used to await this <a class="xref" href="Grpc.Core.AsyncUnaryCall-1.html">AsyncUnaryCall&lt;TResponse&gt;</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public ConfiguredTaskAwaitable&lt;TResponse&gt; ConfigureAwait(bool continueOnCapturedContext)</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.Boolean</span></td>
<td><span class="parametername">continueOnCapturedContext</span></td>
<td><p>true to attempt to marshal the continuation back to the original context captured; otherwise, false.</p>
</td>
</tr>
</tbody>
</table>
<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.ConfiguredTaskAwaitable</span>&lt;TResponse&gt;</td>
<td><p>An object used to await this task.</p>
</td>
</tr>
</tbody>
</table>
<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&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_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
&quot;Cancel&quot; 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>Gets an awaiter used to await this <a class="xref" href="Grpc.Core.AsyncUnaryCall-1.html">AsyncUnaryCall&lt;TResponse&gt;</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public TaskAwaiter&lt;TResponse&gt; 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>&lt;TResponse&gt;</td>
<td><p>An awaiter instance.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="Grpc_Core_AsyncUnaryCall_1_GetAwaiter_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method is intended for compiler use rather than use directly in code.</p>
</div>
<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>