aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/countqueuingstrategy/size/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/api/countqueuingstrategy/size/index.html')
-rw-r--r--files/ja/web/api/countqueuingstrategy/size/index.html70
1 files changed, 70 insertions, 0 deletions
diff --git a/files/ja/web/api/countqueuingstrategy/size/index.html b/files/ja/web/api/countqueuingstrategy/size/index.html
new file mode 100644
index 0000000000..b54d66a65d
--- /dev/null
+++ b/files/ja/web/api/countqueuingstrategy/size/index.html
@@ -0,0 +1,70 @@
+---
+title: CountQueuingStrategy.size()
+slug: Web/API/CountQueuingStrategy/size
+tags:
+ - API
+ - CountQueuingStrategy
+ - Experimental
+ - Method
+ - Reference
+ - Streams
+ - size
+translation_of: Web/API/CountQueuingStrategy/size
+---
+<div>{{draft}}{{SeeCompatTable}}{{APIRef("Streams")}}</div>
+
+<p class="summary"><span class="seoSummary">{{domxref("CountQueuingStrategy")}} インターフェイスの <strong><code>size()</code></strong> メソッドは常に <code>1</code> を返すため、合計キューサイズはキュー内のチャンク数を数えたものになります。</span></p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox"><var><code>var <em>size</em> = </code>countQueuingStrategy</var>.size();</pre>
+
+<h3 id="Parameters" name="Parameters">パラメーター</h3>
+
+<p>なし。</p>
+
+<h3 id="Return_value" name="Return_value">戻り値</h3>
+
+<p><code>1</code>。</p>
+
+<h2 id="Examples" name="Examples">例</h2>
+
+<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">const</span> queuingStrategy <span class="operator token">=</span> <span class="keyword token">new</span> <span class="class-name token">CountQueuingStrategy</span><span class="punctuation token">(</span><span class="punctuation token">{</span> highWaterMark<span class="punctuation token">:</span> <span class="number token">1</span> <span class="punctuation token">}</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="keyword token">const</span> writableStream <span class="operator token">=</span> <span class="keyword token">new</span> <span class="class-name token">WritableStream</span><span class="punctuation token">(</span><span class="punctuation token">{</span>
+ <span class="comment token">// シンクの実装</span>
+ <span class="function token">write</span><span class="punctuation token">(</span>chunk<span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ <span class="punctuation token">.</span><span class="punctuation token">.</span><span class="punctuation token">.</span>
+ <span class="punctuation token">}</span><span class="punctuation token">,</span>
+ <span class="function token">close</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ <span class="punctuation token">.</span><span class="punctuation token">.</span><span class="punctuation token">.</span>
+ <span class="punctuation token">}</span><span class="punctuation token">,</span>
+ <span class="function token">abort</span><span class="punctuation token">(</span>err<span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="string token">"Sink error:"</span><span class="punctuation token">,</span> err<span class="punctuation token">)</span><span class="punctuation token">;</span>
+ <span class="punctuation token">}</span>
+<span class="punctuation token">}</span><span class="punctuation token">,</span> queuingStrategy<span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="keyword token">var</span> size <span class="operator token">=</span> queuingStrategy<span class="punctuation token">.</span><span class="function token">size</span><span class="punctuation token">(</span><span class="punctuation token">)</span></code>;</pre>
+
+<h2 id="Specifications" name="Specifications">仕様</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">仕様</th>
+ <th scope="col">状態</th>
+ <th scope="col">コメント</th>
+ </tr>
+ <tr>
+ <td>{{SpecName("Streams","#cqs-size","size")}}</td>
+ <td>{{Spec2('Streams')}}</td>
+ <td>初期定義</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+
+
+<p>{{Compat("api.CountQueuingStrategy.size")}}</p>