|
| 1 | +<!DOCTYPE html> |
| 2 | +<!--[if IE]><![endif]--> |
| 3 | +<html> |
| 4 | + |
| 5 | + <head> |
| 6 | + <meta charset="utf-8"> |
| 7 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 8 | + <title>Class AsyncQueue<T> |
| 9 | + | Advanced Algorithms </title> |
| 10 | + <meta name="viewport" content="width=device-width"> |
| 11 | + <meta name="title" content="Class AsyncQueue<T> |
| 12 | + | Advanced Algorithms "> |
| 13 | + <meta name="generator" content="docfx 2.37.2.0"> |
| 14 | + |
| 15 | + <link rel="shortcut icon" href="../favicon.ico"> |
| 16 | + <link rel="stylesheet" href="../styles/docfx.vendor.css"> |
| 17 | + <link rel="stylesheet" href="../styles/docfx.css"> |
| 18 | + <link rel="stylesheet" href="../styles/main.css"> |
| 19 | + <meta property="docfx:navrel" content=""> |
| 20 | + <meta property="docfx:tocrel" content="toc.html"> |
| 21 | + |
| 22 | + <meta property="docfx:rel" content="../"> |
| 23 | + |
| 24 | + </head> |
| 25 | + <body data-spy="scroll" data-target="#affix" data-offset="120"> |
| 26 | + <div id="wrapper"> |
| 27 | + <header> |
| 28 | + |
| 29 | + <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation"> |
| 30 | + <div class="container"> |
| 31 | + <div class="navbar-header"> |
| 32 | + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> |
| 33 | + <span class="sr-only">Toggle navigation</span> |
| 34 | + <span class="icon-bar"></span> |
| 35 | + <span class="icon-bar"></span> |
| 36 | + <span class="icon-bar"></span> |
| 37 | + </button> |
| 38 | + |
| 39 | + <a class="navbar-brand" href="../index.html"> |
| 40 | + <img id="logo" class="svg" src="../logo.svg" alt=""> |
| 41 | + </a> |
| 42 | + </div> |
| 43 | + <div class="collapse navbar-collapse" id="navbar"> |
| 44 | + <form class="navbar-form navbar-right" role="search" id="search"> |
| 45 | + <div class="form-group"> |
| 46 | + <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off"> |
| 47 | + </div> |
| 48 | + </form> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + </nav> |
| 52 | + |
| 53 | + <div class="subnav navbar navbar-default"> |
| 54 | + <div class="container hide-when-search" id="breadcrumb"> |
| 55 | + <ul class="breadcrumb"> |
| 56 | + <li></li> |
| 57 | + </ul> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + </header> |
| 61 | + <div class="container body-content"> |
| 62 | + |
| 63 | + <div id="search-results"> |
| 64 | + <div class="search-list"></div> |
| 65 | + <div class="sr-items"> |
| 66 | + <p><i class="glyphicon glyphicon-refresh index-loading"></i></p> |
| 67 | + </div> |
| 68 | + <ul id="pagination"></ul> |
| 69 | + </div> |
| 70 | + </div> |
| 71 | + <div role="main" class="container body-content hide-when-search"> |
| 72 | + |
| 73 | + <div class="sidenav hide-when-search"> |
| 74 | + <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a> |
| 75 | + <div class="sidetoggle collapse" id="sidetoggle"> |
| 76 | + <div id="sidetoc"></div> |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + <div class="article row grid-right"> |
| 80 | + <div class="col-md-10"> |
| 81 | + <article class="content wrap" id="_content" data-uid="Advanced.Algorithms.Distributed.AsyncQueue`1"> |
| 82 | + |
| 83 | + |
| 84 | + <h1 id="Advanced_Algorithms_Distributed_AsyncQueue_1" data-uid="Advanced.Algorithms.Distributed.AsyncQueue`1" class="text-break">Class AsyncQueue<T> |
| 85 | + </h1> |
| 86 | + <div class="markdown level0 summary"><p>A simple asynchronous multi-thread supporting producer/consumer FIFO queue with minimal locking.</p> |
| 87 | +</div> |
| 88 | + <div class="markdown level0 conceptual"></div> |
| 89 | + <div class="inheritance"> |
| 90 | + <h5>Inheritance</h5> |
| 91 | + <div class="level0"><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></div> |
| 92 | + <div class="level1"><span class="xref">AsyncQueue<T></span></div> |
| 93 | + </div> |
| 94 | + <div class="inheritedMembers"> |
| 95 | + <h5>Inherited Members</h5> |
| 96 | + <div> |
| 97 | + <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.tostring#System_Object_ToString">Object.ToString()</a> |
| 98 | + </div> |
| 99 | + <div> |
| 100 | + <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_">Object.Equals(Object)</a> |
| 101 | + </div> |
| 102 | + <div> |
| 103 | + <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_System_Object_">Object.Equals(Object, Object)</a> |
| 104 | + </div> |
| 105 | + <div> |
| 106 | + <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.referenceequals#System_Object_ReferenceEquals_System_Object_System_Object_">Object.ReferenceEquals(Object, Object)</a> |
| 107 | + </div> |
| 108 | + <div> |
| 109 | + <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gethashcode#System_Object_GetHashCode">Object.GetHashCode()</a> |
| 110 | + </div> |
| 111 | + <div> |
| 112 | + <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gettype#System_Object_GetType">Object.GetType()</a> |
| 113 | + </div> |
| 114 | + <div> |
| 115 | + <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.memberwiseclone#System_Object_MemberwiseClone">Object.MemberwiseClone()</a> |
| 116 | + </div> |
| 117 | + </div> |
| 118 | + <h6><strong>Namespace</strong>: <a class="xref" href="Advanced.Algorithms.Distributed.html">Advanced.Algorithms.Distributed</a></h6> |
| 119 | + <h6><strong>Assembly</strong>: Advanced.Algorithms.dll</h6> |
| 120 | + <h5 id="Advanced_Algorithms_Distributed_AsyncQueue_1_syntax">Syntax</h5> |
| 121 | + <div class="codewrapper"> |
| 122 | + <pre><code class="lang-csharp hljs">public class AsyncQueue<T></code></pre> |
| 123 | + </div> |
| 124 | + <h5 class="typeParameters">Type Parameters</h5> |
| 125 | + <table class="table table-bordered table-striped table-condensed"> |
| 126 | + <thead> |
| 127 | + <tr> |
| 128 | + <th>Name</th> |
| 129 | + <th>Description</th> |
| 130 | + </tr> |
| 131 | + </thead> |
| 132 | + <tbody> |
| 133 | + <tr> |
| 134 | + <td><span class="parametername">T</span></td> |
| 135 | + <td></td> |
| 136 | + </tr> |
| 137 | + </tbody> |
| 138 | + </table> |
| 139 | + <h3 id="methods">Methods |
| 140 | + </h3> |
| 141 | + |
| 142 | + |
| 143 | + <a id="Advanced_Algorithms_Distributed_AsyncQueue_1_DequeueAsync_" data-uid="Advanced.Algorithms.Distributed.AsyncQueue`1.DequeueAsync*"></a> |
| 144 | + <h4 id="Advanced_Algorithms_Distributed_AsyncQueue_1_DequeueAsync_System_Threading_CancellationToken_" data-uid="Advanced.Algorithms.Distributed.AsyncQueue`1.DequeueAsync(System.Threading.CancellationToken)">DequeueAsync(CancellationToken)</h4> |
| 145 | + <div class="markdown level1 summary"><p>Supports multi-threaded consumers. |
| 146 | +Time complexity: O(1).</p> |
| 147 | +</div> |
| 148 | + <div class="markdown level1 conceptual"></div> |
| 149 | + <h5 class="decalaration">Declaration</h5> |
| 150 | + <div class="codewrapper"> |
| 151 | + <pre><code class="lang-csharp hljs">public Task<T> DequeueAsync(CancellationToken taskCancellationToken = default(CancellationToken))</code></pre> |
| 152 | + </div> |
| 153 | + <h5 class="parameters">Parameters</h5> |
| 154 | + <table class="table table-bordered table-striped table-condensed"> |
| 155 | + <thead> |
| 156 | + <tr> |
| 157 | + <th>Type</th> |
| 158 | + <th>Name</th> |
| 159 | + <th>Description</th> |
| 160 | + </tr> |
| 161 | + </thead> |
| 162 | + <tbody> |
| 163 | + <tr> |
| 164 | + <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a></td> |
| 165 | + <td><span class="parametername">taskCancellationToken</span></td> |
| 166 | + <td></td> |
| 167 | + </tr> |
| 168 | + </tbody> |
| 169 | + </table> |
| 170 | + <h5 class="returns">Returns</h5> |
| 171 | + <table class="table table-bordered table-striped table-condensed"> |
| 172 | + <thead> |
| 173 | + <tr> |
| 174 | + <th>Type</th> |
| 175 | + <th>Description</th> |
| 176 | + </tr> |
| 177 | + </thead> |
| 178 | + <tbody> |
| 179 | + <tr> |
| 180 | + <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1">Task</a><T></td> |
| 181 | + <td></td> |
| 182 | + </tr> |
| 183 | + </tbody> |
| 184 | + </table> |
| 185 | + |
| 186 | + |
| 187 | + <a id="Advanced_Algorithms_Distributed_AsyncQueue_1_EnqueueAsync_" data-uid="Advanced.Algorithms.Distributed.AsyncQueue`1.EnqueueAsync*"></a> |
| 188 | + <h4 id="Advanced_Algorithms_Distributed_AsyncQueue_1_EnqueueAsync__0_System_Threading_CancellationToken_" data-uid="Advanced.Algorithms.Distributed.AsyncQueue`1.EnqueueAsync(`0,System.Threading.CancellationToken)">EnqueueAsync(T, CancellationToken)</h4> |
| 189 | + <div class="markdown level1 summary"><p>Supports multi-threaded producers. |
| 190 | +Time complexity: O(1).</p> |
| 191 | +</div> |
| 192 | + <div class="markdown level1 conceptual"></div> |
| 193 | + <h5 class="decalaration">Declaration</h5> |
| 194 | + <div class="codewrapper"> |
| 195 | + <pre><code class="lang-csharp hljs">public Task EnqueueAsync(T value, CancellationToken taskCancellationToken = default(CancellationToken))</code></pre> |
| 196 | + </div> |
| 197 | + <h5 class="parameters">Parameters</h5> |
| 198 | + <table class="table table-bordered table-striped table-condensed"> |
| 199 | + <thead> |
| 200 | + <tr> |
| 201 | + <th>Type</th> |
| 202 | + <th>Name</th> |
| 203 | + <th>Description</th> |
| 204 | + </tr> |
| 205 | + </thead> |
| 206 | + <tbody> |
| 207 | + <tr> |
| 208 | + <td><span class="xref">T</span></td> |
| 209 | + <td><span class="parametername">value</span></td> |
| 210 | + <td></td> |
| 211 | + </tr> |
| 212 | + <tr> |
| 213 | + <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a></td> |
| 214 | + <td><span class="parametername">taskCancellationToken</span></td> |
| 215 | + <td></td> |
| 216 | + </tr> |
| 217 | + </tbody> |
| 218 | + </table> |
| 219 | + <h5 class="returns">Returns</h5> |
| 220 | + <table class="table table-bordered table-striped table-condensed"> |
| 221 | + <thead> |
| 222 | + <tr> |
| 223 | + <th>Type</th> |
| 224 | + <th>Description</th> |
| 225 | + </tr> |
| 226 | + </thead> |
| 227 | + <tbody> |
| 228 | + <tr> |
| 229 | + <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td> |
| 230 | + <td></td> |
| 231 | + </tr> |
| 232 | + </tbody> |
| 233 | + </table> |
| 234 | +</article> |
| 235 | + </div> |
| 236 | + |
| 237 | + <div class="hidden-sm col-md-2" role="complementary"> |
| 238 | + <div class="sideaffix"> |
| 239 | + <div class="contribution"> |
| 240 | + <ul class="nav"> |
| 241 | + </ul> |
| 242 | + </div> |
| 243 | + <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix"> |
| 244 | + <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> --> |
| 245 | + </nav> |
| 246 | + </div> |
| 247 | + </div> |
| 248 | + </div> |
| 249 | + </div> |
| 250 | + |
| 251 | + <footer> |
| 252 | + <div class="grad-bottom"></div> |
| 253 | + <div class="footer"> |
| 254 | + <div class="container"> |
| 255 | + <span class="pull-right"> |
| 256 | + <a href="#top">Back to top</a> |
| 257 | + </span> |
| 258 | + |
| 259 | + <span>Generated by <strong>DocFX</strong></span> |
| 260 | + </div> |
| 261 | + </div> |
| 262 | + </footer> |
| 263 | + </div> |
| 264 | + |
| 265 | + <script type="text/javascript" src="../styles/docfx.vendor.js"></script> |
| 266 | + <script type="text/javascript" src="../styles/docfx.js"></script> |
| 267 | + <script type="text/javascript" src="../styles/main.js"></script> |
| 268 | + </body> |
| 269 | +</html> |
0 commit comments