ruff 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,682 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Ruff::Standard::Async::Instance
8
+
9
+ &mdash; Ruff 1.3.0 Documentation
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Ruff::Standard::Async::Instance";
19
+ relpath = '../../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../../_index.html">Index (I)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../../Ruff.html" title="Ruff (module)">Ruff</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Standard.html" title="Ruff::Standard (module)">Standard</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Async.html" title="Ruff::Standard::Async (module)">Async</a></span></span>
41
+ &raquo;
42
+ <span class="title">Instance</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Ruff::Standard::Async::Instance
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Ruff::Standard::Async::Instance</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/ruff/standard/async.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#eff-instance_method" title="#eff (instance method)">#<strong>eff</strong> &#x21d2; Object </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+ <span class="note title readonly">readonly</span>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <span class="summary_desc"><div class='inline'><p>You can reimplement the handler using these effect instances with accessing <code>Async.async</code> , <code>Async.yield</code> , and <code>Async.await</code> .</p>
132
+ </div></span>
133
+
134
+ </li>
135
+
136
+
137
+ </ul>
138
+
139
+
140
+
141
+
142
+
143
+ <h2>
144
+ Instance Method Summary
145
+ <small><a href="#" class="summary_toggle">collapse</a></small>
146
+ </h2>
147
+
148
+ <ul class="summary">
149
+
150
+ <li class="public ">
151
+ <span class="summary_signature">
152
+
153
+ <a href="#async-instance_method" title="#async (instance method)">#<strong>async</strong>(th) &#x21d2; Promise&lt;A&gt; </a>
154
+
155
+
156
+
157
+ </span>
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+ <span class="summary_desc"><div class='inline'><p>is a smart method to invoke the effect operation <code>Async.async</code> .</p>
168
+ </div></span>
169
+
170
+ </li>
171
+
172
+
173
+ <li class="public ">
174
+ <span class="summary_signature">
175
+
176
+ <a href="#await-instance_method" title="#await (instance method)">#<strong>await</strong>(p) &#x21d2; A </a>
177
+
178
+
179
+
180
+ </span>
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+ <span class="summary_desc"><div class='inline'><p>is a smart method to invoke the effect operation <code>Async.await</code> .</p>
191
+ </div></span>
192
+
193
+ </li>
194
+
195
+
196
+ <li class="public ">
197
+ <span class="summary_signature">
198
+
199
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> &#x21d2; Instance </a>
200
+
201
+
202
+
203
+ </span>
204
+
205
+
206
+ <span class="note title constructor">constructor</span>
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <span class="summary_desc"><div class='inline'><p>makes a new instance.</p>
216
+ </div></span>
217
+
218
+ </li>
219
+
220
+
221
+ <li class="public ">
222
+ <span class="summary_signature">
223
+
224
+ <a href="#with-instance_method" title="#with (instance method)">#<strong>with</strong> &#x21d2; ()!{e} </a>
225
+
226
+
227
+
228
+ </span>
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+ <span class="summary_desc"><div class='inline'><p>Returns unit but still has the possibility to invoke effects <code>e</code> .</p>
239
+ </div></span>
240
+
241
+ </li>
242
+
243
+
244
+ <li class="public ">
245
+ <span class="summary_signature">
246
+
247
+ <a href="#yield-instance_method" title="#yield (instance method)">#<strong>yield</strong> &#x21d2; () </a>
248
+
249
+
250
+
251
+ </span>
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+ <span class="summary_desc"><div class='inline'><p>is a smart method to invoke the effect operation <code>Async.yield</code> .</p>
262
+ </div></span>
263
+
264
+ </li>
265
+
266
+
267
+ </ul>
268
+
269
+
270
+ <div id="constructor_details" class="method_details_list">
271
+ <h2>Constructor Details</h2>
272
+
273
+ <div class="method_details first">
274
+ <h3 class="signature first" id="initialize-instance_method">
275
+
276
+ #<strong>initialize</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Ruff::Standard::Async::Instance (class)">Instance</a></span></tt>
277
+
278
+
279
+
280
+
281
+
282
+ </h3><div class="docstring">
283
+ <div class="discussion">
284
+ <p>makes a new instance.</p>
285
+
286
+
287
+ </div>
288
+ </div>
289
+ <div class="tags">
290
+
291
+
292
+ </div><table class="source_code">
293
+ <tr>
294
+ <td>
295
+ <pre class="lines">
296
+
297
+
298
+ 54
299
+ 55
300
+ 56
301
+ 57
302
+ 58
303
+ 59
304
+ 60
305
+ 61
306
+ 62
307
+ 63
308
+ 64</pre>
309
+ </td>
310
+ <td>
311
+ <pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 54</span>
312
+
313
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
314
+ <span class='comment'># delegates effect instances.
315
+ </span> <span class='ivar'>@eff</span> <span class='op'>=</span> <span class='const'>OpenStruct</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
316
+ <span class='label'>async:</span> <span class='const'><span class='object_link'><a href="../../../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'><span class='object_link'><a href="../../../Ruff.html#instance-class_method" title="Ruff.instance (method)">instance</a></span></span><span class='comma'>,</span>
317
+ <span class='label'>yield:</span> <span class='const'><span class='object_link'><a href="../../../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'><span class='object_link'><a href="../../../Ruff.html#instance-class_method" title="Ruff.instance (method)">instance</a></span></span><span class='comma'>,</span>
318
+ <span class='label'>await:</span> <span class='const'><span class='object_link'><a href="../../../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'><span class='object_link'><a href="../../../Ruff.html#instance-class_method" title="Ruff.instance (method)">instance</a></span></span>
319
+ <span class='rparen'>)</span>
320
+
321
+ <span class='comment'># is a proc queue.
322
+ </span> <span class='ivar'>@q</span> <span class='op'>=</span> <span class='const'>Util</span><span class='op'>::</span><span class='const'>FnStack</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
323
+ <span class='kw'>end</span></pre>
324
+ </td>
325
+ </tr>
326
+ </table>
327
+ </div>
328
+
329
+ </div>
330
+
331
+ <div id="instance_attr_details" class="attr_details">
332
+ <h2>Instance Attribute Details</h2>
333
+
334
+
335
+ <span id=""></span>
336
+ <div class="method_details first">
337
+ <h3 class="signature first" id="eff-instance_method">
338
+
339
+ #<strong>eff</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
340
+
341
+
342
+
343
+
344
+
345
+ </h3><div class="docstring">
346
+ <div class="discussion">
347
+ <p>You can reimplement the handler using these effect instances
348
+ with accessing <code>Async.async</code> , <code>Async.yield</code> , and <code>Async.await</code> .</p>
349
+
350
+
351
+ </div>
352
+ </div>
353
+ <div class="tags">
354
+
355
+
356
+ </div><table class="source_code">
357
+ <tr>
358
+ <td>
359
+ <pre class="lines">
360
+
361
+
362
+ 103
363
+ 104
364
+ 105</pre>
365
+ </td>
366
+ <td>
367
+ <pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 103</span>
368
+
369
+ <span class='kw'>def</span> <span class='id identifier rubyid_eff'>eff</span>
370
+ <span class='ivar'>@eff</span>
371
+ <span class='kw'>end</span></pre>
372
+ </td>
373
+ </tr>
374
+ </table>
375
+ </div>
376
+
377
+ </div>
378
+
379
+
380
+ <div id="instance_method_details" class="method_details_list">
381
+ <h2>Instance Method Details</h2>
382
+
383
+
384
+ <div class="method_details first">
385
+ <h3 class="signature first" id="async-instance_method">
386
+
387
+ #<strong>async</strong>(th) &#x21d2; <tt>Promise&lt;A&gt;</tt>
388
+
389
+
390
+
391
+
392
+
393
+ </h3><div class="docstring">
394
+ <div class="discussion">
395
+ <p>is a smart method to invoke the effect operation <code>Async.async</code> .</p>
396
+
397
+
398
+ </div>
399
+ </div>
400
+ <div class="tags">
401
+ <p class="tag_title">Parameters:</p>
402
+ <ul class="param">
403
+
404
+ <li>
405
+
406
+ <span class='name'>th</span>
407
+
408
+
409
+ <span class='type'>(<tt>Proc&lt;(), A&gt;</tt>)</span>
410
+
411
+
412
+
413
+ &mdash;
414
+ <div class='inline'><p>is a thunk asynchronously computed.</p>
415
+ </div>
416
+
417
+ </li>
418
+
419
+ </ul>
420
+
421
+ <p class="tag_title">Returns:</p>
422
+ <ul class="return">
423
+
424
+ <li>
425
+
426
+
427
+ <span class='type'>(<tt>Promise&lt;A&gt;</tt>)</span>
428
+
429
+
430
+
431
+ &mdash;
432
+ <div class='inline'><p>with <code>with</code> , returns <code>Promise&lt;A&gt;</code> with running concurrently .</p>
433
+ </div>
434
+
435
+ </li>
436
+
437
+ </ul>
438
+
439
+ </div><table class="source_code">
440
+ <tr>
441
+ <td>
442
+ <pre class="lines">
443
+
444
+
445
+ 71
446
+ 72
447
+ 73</pre>
448
+ </td>
449
+ <td>
450
+ <pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 71</span>
451
+
452
+ <span class='kw'>def</span> <span class='id identifier rubyid_async'>async</span><span class='lparen'>(</span><span class='id identifier rubyid_th'>th</span><span class='rparen'>)</span>
453
+ <span class='ivar'>@eff</span><span class='period'>.</span><span class='id identifier rubyid_async'>async</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span> <span class='id identifier rubyid_th'>th</span>
454
+ <span class='kw'>end</span></pre>
455
+ </td>
456
+ </tr>
457
+ </table>
458
+ </div>
459
+
460
+ <div class="method_details ">
461
+ <h3 class="signature " id="await-instance_method">
462
+
463
+ #<strong>await</strong>(p) &#x21d2; <tt>A</tt>
464
+
465
+
466
+
467
+
468
+
469
+ </h3><div class="docstring">
470
+ <div class="discussion">
471
+ <p>is a smart method to invoke the effect operation <code>Async.await</code> .</p>
472
+
473
+
474
+ </div>
475
+ </div>
476
+ <div class="tags">
477
+ <p class="tag_title">Parameters:</p>
478
+ <ul class="param">
479
+
480
+ <li>
481
+
482
+ <span class='name'>p</span>
483
+
484
+
485
+ <span class='type'>(<tt>Promise&lt;A&gt;</tt>)</span>
486
+
487
+
488
+
489
+ &mdash;
490
+ <div class='inline'><p>is a promise to run.</p>
491
+ </div>
492
+
493
+ </li>
494
+
495
+ </ul>
496
+
497
+ <p class="tag_title">Returns:</p>
498
+ <ul class="return">
499
+
500
+ <li>
501
+
502
+
503
+ <span class='type'>(<tt>A</tt>)</span>
504
+
505
+
506
+
507
+ &mdash;
508
+ <div class='inline'><p>with <code>with</code> returns the result of <em>promise</em> computation.</p>
509
+ </div>
510
+
511
+ </li>
512
+
513
+ </ul>
514
+
515
+ </div><table class="source_code">
516
+ <tr>
517
+ <td>
518
+ <pre class="lines">
519
+
520
+
521
+ 87
522
+ 88
523
+ 89</pre>
524
+ </td>
525
+ <td>
526
+ <pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 87</span>
527
+
528
+ <span class='kw'>def</span> <span class='id identifier rubyid_await'>await</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='rparen'>)</span>
529
+ <span class='ivar'>@eff</span><span class='period'>.</span><span class='id identifier rubyid_await'>await</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span> <span class='id identifier rubyid_p'>p</span>
530
+ <span class='kw'>end</span></pre>
531
+ </td>
532
+ </tr>
533
+ </table>
534
+ </div>
535
+
536
+ <div class="method_details ">
537
+ <h3 class="signature " id="with-instance_method">
538
+
539
+ #<strong>with</strong> &#x21d2; <tt>()!{e}</tt>
540
+
541
+
542
+
543
+
544
+
545
+ </h3><div class="docstring">
546
+ <div class="discussion">
547
+ <p>Returns unit but still has the possibility to invoke effects <code>e</code> .</p>
548
+
549
+
550
+ </div>
551
+ </div>
552
+ <div class="tags">
553
+ <p class="tag_title">Parameters:</p>
554
+ <ul class="param">
555
+
556
+ <li>
557
+
558
+ <span class='name'>th</span>
559
+
560
+
561
+ <span class='type'>(<tt>Proc&lt;(), _A!{<span class='object_link'><a href="../Async.html" title="Ruff::Standard::Async (module)">Async</a></span>.<span class='object_link'><a href="#async-instance_method" title="Ruff::Standard::Async::Instance#async (method)">async</a></span>, <span class='object_link'><a href="../Async.html" title="Ruff::Standard::Async (module)">Async</a></span>.<span class='object_link'><a href="#yield-instance_method" title="Ruff::Standard::Async::Instance#yield (method)">yield</a></span>, <span class='object_link'><a href="../Async.html" title="Ruff::Standard::Async (module)">Async</a></span>.<span class='object_link'><a href="#await-instance_method" title="Ruff::Standard::Async::Instance#await (method)">await</a></span>, e}&gt;</tt>)</span>
562
+
563
+
564
+
565
+ &mdash;
566
+ <div class='inline'><p>is a thunk returning <code>_A</code> with te possibility to invoke effects,
567
+ including <code>Async.async</code> , <code>Async.yield</code> and <code>Async.await</code> .</p>
568
+ </div>
569
+
570
+ </li>
571
+
572
+ </ul>
573
+
574
+ <p class="tag_title">Returns:</p>
575
+ <ul class="return">
576
+
577
+ <li>
578
+
579
+
580
+ <span class='type'>(<tt>()!{e}</tt>)</span>
581
+
582
+
583
+
584
+ &mdash;
585
+ <div class='inline'><p>returns unit but still has the possibility to invoke effects <code>e</code> .</p>
586
+ </div>
587
+
588
+ </li>
589
+
590
+ </ul>
591
+
592
+ </div><table class="source_code">
593
+ <tr>
594
+ <td>
595
+ <pre class="lines">
596
+
597
+
598
+ 97
599
+ 98
600
+ 99</pre>
601
+ </td>
602
+ <td>
603
+ <pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 97</span>
604
+
605
+ <span class='id identifier rubyid_define_method'>define_method</span> <span class='symbol'>:with</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>&amp;</span><span class='id identifier rubyid_th'>th</span><span class='op'>|</span>
606
+ <span class='id identifier rubyid_fork'>fork</span><span class='lparen'>(</span><span class='const'>Util</span><span class='op'>::</span><span class='const'>Ref</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid__Waiting'>_Waiting</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_th'>th</span><span class='rparen'>)</span>
607
+ <span class='kw'>end</span></pre>
608
+ </td>
609
+ </tr>
610
+ </table>
611
+ </div>
612
+
613
+ <div class="method_details ">
614
+ <h3 class="signature " id="yield-instance_method">
615
+
616
+ #<strong>yield</strong> &#x21d2; <tt>()</tt>
617
+
618
+
619
+
620
+
621
+
622
+ </h3><div class="docstring">
623
+ <div class="discussion">
624
+ <p>is a smart method to invoke the effect operation <code>Async.yield</code> .</p>
625
+
626
+
627
+ </div>
628
+ </div>
629
+ <div class="tags">
630
+
631
+ <p class="tag_title">Returns:</p>
632
+ <ul class="return">
633
+
634
+ <li>
635
+
636
+
637
+ <span class='type'>(<tt>()</tt>)</span>
638
+
639
+
640
+
641
+ &mdash;
642
+ <div class='inline'><p>with <code>with</code> , yields the control to another task.</p>
643
+ </div>
644
+
645
+ </li>
646
+
647
+ </ul>
648
+
649
+ </div><table class="source_code">
650
+ <tr>
651
+ <td>
652
+ <pre class="lines">
653
+
654
+
655
+ 78
656
+ 79
657
+ 80</pre>
658
+ </td>
659
+ <td>
660
+ <pre class="code"><span class="info file"># File 'lib/ruff/standard/async.rb', line 78</span>
661
+
662
+ <span class='kw'>def</span> <span class='kw'>yield</span>
663
+ <span class='ivar'>@eff</span><span class='period'>.</span><span class='id identifier rubyid_yield'>yield</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span>
664
+ <span class='kw'>end</span></pre>
665
+ </td>
666
+ </tr>
667
+ </table>
668
+ </div>
669
+
670
+ </div>
671
+
672
+ </div>
673
+
674
+ <div id="footer">
675
+ Generated on Sun Oct 6 23:09:11 2019 by
676
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
677
+ 0.9.20 (ruby-2.6.5).
678
+ </div>
679
+
680
+ </div>
681
+ </body>
682
+ </html>