ionian 0.6.12 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/doc/Ionian.html +3 -3
- data/doc/Ionian/Extension.html +1 -1
- data/doc/Ionian/Extension/IO.html +175 -56
- data/doc/Ionian/Extension/Socket.html +229 -122
- data/doc/Ionian/ManagedSocket.html +946 -0
- data/doc/Ionian/Server.html +1 -1
- data/doc/Ionian/Socket.html +720 -138
- data/doc/_index.html +16 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +14 -1
- data/doc/file.license.html +1 -1
- data/doc/index.html +14 -1
- data/doc/method_list.html +137 -47
- data/doc/top-level-namespace.html +1 -1
- data/lib/ionian.rb +1 -0
- data/lib/ionian/extension/io.rb +26 -8
- data/lib/ionian/extension/socket.rb +18 -18
- data/lib/ionian/managed_socket.rb +109 -0
- data/lib/ionian/socket.rb +65 -18
- metadata +5 -3
@@ -0,0 +1,946 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Ionian::ManagedSocket
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
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
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!Ionian/ManagedSocket.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (M)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Ionian.html" title="Ionian (module)">Ionian</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">ManagedSocket</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Ionian::ManagedSocket
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Ionian::ManagedSocket</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/ionian/managed_socket.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>A socket manager that wraps an <span class='object_link'><a href="Socket.html" title="Ionian::Socket (class)">Socket</a></span> and can perform functions
|
106
|
+
like heartbeating and auto-reconnect.</p>
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
<div class="tags">
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
119
|
+
<ul class="summary">
|
120
|
+
|
121
|
+
<li class="public ">
|
122
|
+
<span class="summary_signature">
|
123
|
+
|
124
|
+
<a href="#auto_reconnect-instance_method" title="#auto_reconnect (instance method)">- (Object) <strong>auto_reconnect</strong> </a>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
</span>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="note title readonly">readonly</span>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
<span class="summary_desc"><div class='inline'>
|
144
|
+
<p>When true, automatically reconnect if the socket closes.</p>
|
145
|
+
</div></span>
|
146
|
+
|
147
|
+
</li>
|
148
|
+
|
149
|
+
|
150
|
+
</ul>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<h2>
|
157
|
+
Instance Method Summary
|
158
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
159
|
+
</h2>
|
160
|
+
|
161
|
+
<ul class="summary">
|
162
|
+
|
163
|
+
<li class="public ">
|
164
|
+
<span class="summary_signature">
|
165
|
+
|
166
|
+
<a href="#close-instance_method" title="#close (instance method)">- (Object) <strong>close</strong> </a>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
</span>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
<span class="summary_desc"><div class='inline'>
|
181
|
+
<p>Close the socket.</p>
|
182
|
+
</div></span>
|
183
|
+
|
184
|
+
</li>
|
185
|
+
|
186
|
+
|
187
|
+
<li class="public ">
|
188
|
+
<span class="summary_signature">
|
189
|
+
|
190
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (ManagedSocket) <strong>initialize</strong>(**kwargs) </a>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</span>
|
195
|
+
|
196
|
+
|
197
|
+
<span class="note title constructor">constructor</span>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<span class="summary_desc"><div class='inline'>
|
207
|
+
<p>A new instance of ManagedSocket.</p>
|
208
|
+
</div></span>
|
209
|
+
|
210
|
+
</li>
|
211
|
+
|
212
|
+
|
213
|
+
<li class="public ">
|
214
|
+
<span class="summary_signature">
|
215
|
+
|
216
|
+
<a href="#method_missing-instance_method" title="#method_missing (instance method)">- (Object) <strong>method_missing</strong>(meth, *args, &block) </a>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
</span>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
<span class="summary_desc"><div class='inline'>
|
231
|
+
<p>Pass unhandled methods to @socket.</p>
|
232
|
+
</div></span>
|
233
|
+
|
234
|
+
</li>
|
235
|
+
|
236
|
+
|
237
|
+
<li class="public ">
|
238
|
+
<span class="summary_signature">
|
239
|
+
|
240
|
+
<a href="#register_error_handler-instance_method" title="#register_error_handler (instance method)">- (Block) <strong>register_error_handler</strong> {|Exception, self| ... }</a>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
(also: #on_error)
|
245
|
+
|
246
|
+
</span>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
<span class="summary_desc"><div class='inline'>
|
257
|
+
<p>Register a block to be called when <span class='object_link'><a href="Extension/IO.html#run_match-instance_method" title="Ionian::Extension::IO#run_match (method)">Extension::IO#run_match</a></span> raises
|
258
|
+
an error.</p>
|
259
|
+
</div></span>
|
260
|
+
|
261
|
+
</li>
|
262
|
+
|
263
|
+
|
264
|
+
<li class="public ">
|
265
|
+
<span class="summary_signature">
|
266
|
+
|
267
|
+
<a href="#register_match_handler-instance_method" title="#register_match_handler (instance method)">- (Block) <strong>register_match_handler</strong> {|MatchData, self| ... }</a>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
(also: #on_match)
|
272
|
+
|
273
|
+
</span>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
<span class="summary_desc"><div class='inline'>
|
284
|
+
<p>Register a block to be called when <span class='object_link'><a href="Extension/IO.html#run_match-instance_method" title="Ionian::Extension::IO#run_match (method)">Extension::IO#run_match</a></span>
|
285
|
+
receives matched data.</p>
|
286
|
+
</div></span>
|
287
|
+
|
288
|
+
</li>
|
289
|
+
|
290
|
+
|
291
|
+
<li class="public ">
|
292
|
+
<span class="summary_signature">
|
293
|
+
|
294
|
+
<a href="#respond_to_missing%3F-instance_method" title="#respond_to_missing? (instance method)">- (Boolean) <strong>respond_to_missing?</strong>(meth, *args) </a>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
</span>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
309
|
+
|
310
|
+
</li>
|
311
|
+
|
312
|
+
|
313
|
+
<li class="public ">
|
314
|
+
<span class="summary_signature">
|
315
|
+
|
316
|
+
<a href="#unregister_error_handler-instance_method" title="#unregister_error_handler (instance method)">- (Object) <strong>unregister_error_handler</strong>(&block) </a>
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
</span>
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
<span class="summary_desc"><div class='inline'>
|
331
|
+
<p>Unregister a block from being called when a IO#run_match error is
|
332
|
+
raised.</p>
|
333
|
+
</div></span>
|
334
|
+
|
335
|
+
</li>
|
336
|
+
|
337
|
+
|
338
|
+
<li class="public ">
|
339
|
+
<span class="summary_signature">
|
340
|
+
|
341
|
+
<a href="#unregister_match_handler-instance_method" title="#unregister_match_handler (instance method)">- (Object) <strong>unregister_match_handler</strong>(&block) </a>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
</span>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
<span class="summary_desc"><div class='inline'>
|
356
|
+
<p>Unregister a block from being called when matched data is received.</p>
|
357
|
+
</div></span>
|
358
|
+
|
359
|
+
</li>
|
360
|
+
|
361
|
+
|
362
|
+
</ul>
|
363
|
+
|
364
|
+
|
365
|
+
<div id="constructor_details" class="method_details_list">
|
366
|
+
<h2>Constructor Details</h2>
|
367
|
+
|
368
|
+
<div class="method_details first">
|
369
|
+
<h3 class="signature first" id="initialize-instance_method">
|
370
|
+
|
371
|
+
- (<tt><span class='object_link'><a href="" title="Ionian::ManagedSocket (class)">ManagedSocket</a></span></tt>) <strong>initialize</strong>(**kwargs)
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
</h3><div class="docstring">
|
378
|
+
<div class="discussion">
|
379
|
+
|
380
|
+
<p>Returns a new instance of ManagedSocket</p>
|
381
|
+
|
382
|
+
|
383
|
+
</div>
|
384
|
+
</div>
|
385
|
+
<div class="tags">
|
386
|
+
<p class="tag_title">Parameters:</p>
|
387
|
+
<ul class="param">
|
388
|
+
|
389
|
+
<li>
|
390
|
+
|
391
|
+
<span class='name'>kwargs</span>
|
392
|
+
|
393
|
+
|
394
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
—
|
399
|
+
<div class='inline'>
|
400
|
+
<p>a customizable set of options</p>
|
401
|
+
</div>
|
402
|
+
|
403
|
+
</li>
|
404
|
+
|
405
|
+
</ul>
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
<p class="tag_title">Options Hash (<tt>**kwargs</tt>):</p>
|
411
|
+
<ul class="option">
|
412
|
+
|
413
|
+
<li>
|
414
|
+
<span class="name">:auto_reconnect</span>
|
415
|
+
<span class="type">(<tt>Boolean</tt>)</span>
|
416
|
+
<span class="default">
|
417
|
+
|
418
|
+
— default:
|
419
|
+
<tt>false</tt>
|
420
|
+
|
421
|
+
</span>
|
422
|
+
|
423
|
+
— <div class='inline'>
|
424
|
+
<p>Automatically reconnect if the socket closes. Must call <span class='object_link'><a href="#close-instance_method" title="Ionian::ManagedSocket#close (method)">#close</a></span> to break
|
425
|
+
the auto-reconnect loop.</p>
|
426
|
+
</div>
|
427
|
+
|
428
|
+
</li>
|
429
|
+
|
430
|
+
</ul>
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
<p class="tag_title">See Also:</p>
|
435
|
+
<ul class="see">
|
436
|
+
|
437
|
+
<li><span class='object_link'><a href="Socket.html#initialize-instance_method" title="Ionian::Socket#initialize (method)">More optional parameters.</a></span></li>
|
438
|
+
|
439
|
+
</ul>
|
440
|
+
|
441
|
+
</div><table class="source_code">
|
442
|
+
<tr>
|
443
|
+
<td>
|
444
|
+
<pre class="lines">
|
445
|
+
|
446
|
+
|
447
|
+
17
|
448
|
+
18
|
449
|
+
19
|
450
|
+
20
|
451
|
+
21
|
452
|
+
22
|
453
|
+
23
|
454
|
+
24
|
455
|
+
25</pre>
|
456
|
+
</td>
|
457
|
+
<td>
|
458
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/managed_socket.rb', line 17</span>
|
459
|
+
|
460
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span>
|
461
|
+
<span class='ivar'>@auto_reconnect</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:auto_reconnect</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='kw'>false</span>
|
462
|
+
<span class='ivar'>@kwargs</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span>
|
463
|
+
|
464
|
+
<span class='ivar'>@match_handlers</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
465
|
+
<span class='ivar'>@error_handlers</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
466
|
+
|
467
|
+
<span class='id identifier rubyid_create_socket'>create_socket</span>
|
468
|
+
<span class='kw'>end</span></pre>
|
469
|
+
</td>
|
470
|
+
</tr>
|
471
|
+
</table>
|
472
|
+
</div>
|
473
|
+
|
474
|
+
</div>
|
475
|
+
<div id="method_missing_details" class="method_details_list">
|
476
|
+
<h2>Dynamic Method Handling</h2>
|
477
|
+
<p class="notice this">
|
478
|
+
This class handles dynamic methods through the <tt>method_missing</tt> method
|
479
|
+
|
480
|
+
</p>
|
481
|
+
|
482
|
+
<div class="method_details first">
|
483
|
+
<h3 class="signature first" id="method_missing-instance_method">
|
484
|
+
|
485
|
+
- (<tt>Object</tt>) <strong>method_missing</strong>(meth, *args, &block)
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
</h3><div class="docstring">
|
492
|
+
<div class="discussion">
|
493
|
+
|
494
|
+
<p>Pass unhandled methods to @socket.</p>
|
495
|
+
|
496
|
+
|
497
|
+
</div>
|
498
|
+
</div>
|
499
|
+
<div class="tags">
|
500
|
+
|
501
|
+
|
502
|
+
<p class="tag_title">See Also:</p>
|
503
|
+
<ul class="see">
|
504
|
+
|
505
|
+
<li><span class='object_link'><a href="Socket.html" title="Ionian::Socket (class)">Socket</a></span></li>
|
506
|
+
|
507
|
+
</ul>
|
508
|
+
|
509
|
+
</div><table class="source_code">
|
510
|
+
<tr>
|
511
|
+
<td>
|
512
|
+
<pre class="lines">
|
513
|
+
|
514
|
+
|
515
|
+
77
|
516
|
+
78
|
517
|
+
79</pre>
|
518
|
+
</td>
|
519
|
+
<td>
|
520
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/managed_socket.rb', line 77</span>
|
521
|
+
|
522
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span> <span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
523
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid___send__'>__send__</span> <span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
524
|
+
<span class='kw'>end</span></pre>
|
525
|
+
</td>
|
526
|
+
</tr>
|
527
|
+
</table>
|
528
|
+
</div>
|
529
|
+
|
530
|
+
</div>
|
531
|
+
|
532
|
+
<div id="instance_attr_details" class="attr_details">
|
533
|
+
<h2>Instance Attribute Details</h2>
|
534
|
+
|
535
|
+
|
536
|
+
<span id=""></span>
|
537
|
+
<div class="method_details first">
|
538
|
+
<h3 class="signature first" id="auto_reconnect-instance_method">
|
539
|
+
|
540
|
+
- (<tt>Object</tt>) <strong>auto_reconnect</strong> <span class="extras">(readonly)</span>
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
</h3><div class="docstring">
|
547
|
+
<div class="discussion">
|
548
|
+
|
549
|
+
<p>When true, automatically reconnect if the socket closes.</p>
|
550
|
+
|
551
|
+
|
552
|
+
</div>
|
553
|
+
</div>
|
554
|
+
<div class="tags">
|
555
|
+
|
556
|
+
|
557
|
+
</div><table class="source_code">
|
558
|
+
<tr>
|
559
|
+
<td>
|
560
|
+
<pre class="lines">
|
561
|
+
|
562
|
+
|
563
|
+
10
|
564
|
+
11
|
565
|
+
12</pre>
|
566
|
+
</td>
|
567
|
+
<td>
|
568
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/managed_socket.rb', line 10</span>
|
569
|
+
|
570
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_auto_reconnect'>auto_reconnect</span>
|
571
|
+
<span class='ivar'>@auto_reconnect</span>
|
572
|
+
<span class='kw'>end</span></pre>
|
573
|
+
</td>
|
574
|
+
</tr>
|
575
|
+
</table>
|
576
|
+
</div>
|
577
|
+
|
578
|
+
</div>
|
579
|
+
|
580
|
+
|
581
|
+
<div id="instance_method_details" class="method_details_list">
|
582
|
+
<h2>Instance Method Details</h2>
|
583
|
+
|
584
|
+
|
585
|
+
<div class="method_details first">
|
586
|
+
<h3 class="signature first" id="close-instance_method">
|
587
|
+
|
588
|
+
- (<tt>Object</tt>) <strong>close</strong>
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
|
593
|
+
|
594
|
+
</h3><div class="docstring">
|
595
|
+
<div class="discussion">
|
596
|
+
|
597
|
+
<p>Close the socket. Disables :auto_reconnect.</p>
|
598
|
+
|
599
|
+
|
600
|
+
</div>
|
601
|
+
</div>
|
602
|
+
<div class="tags">
|
603
|
+
|
604
|
+
|
605
|
+
</div><table class="source_code">
|
606
|
+
<tr>
|
607
|
+
<td>
|
608
|
+
<pre class="lines">
|
609
|
+
|
610
|
+
|
611
|
+
29
|
612
|
+
30
|
613
|
+
31
|
614
|
+
32</pre>
|
615
|
+
</td>
|
616
|
+
<td>
|
617
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/managed_socket.rb', line 29</span>
|
618
|
+
|
619
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
|
620
|
+
<span class='ivar'>@auto_reconnect</span> <span class='op'>=</span> <span class='kw'>false</span>
|
621
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span> <span class='kw'>unless</span> <span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_closed?'>closed?</span>
|
622
|
+
<span class='kw'>end</span></pre>
|
623
|
+
</td>
|
624
|
+
</tr>
|
625
|
+
</table>
|
626
|
+
</div>
|
627
|
+
|
628
|
+
<div class="method_details ">
|
629
|
+
<h3 class="signature " id="register_error_handler-instance_method">
|
630
|
+
|
631
|
+
- (<tt>Block</tt>) <strong>register_error_handler</strong> {|Exception, self| ... }
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
<span class="aliases">Also known as:
|
636
|
+
<span class="names"><span id='on_error-instance_method'>on_error</span></span>
|
637
|
+
</span>
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
</h3><div class="docstring">
|
642
|
+
<div class="discussion">
|
643
|
+
|
644
|
+
<p>Register a block to be called when <span class='object_link'><a href="Extension/IO.html#run_match-instance_method" title="Ionian::Extension::IO#run_match (method)">Extension::IO#run_match</a></span> raises
|
645
|
+
an error. Method callbacks can be registered with
|
646
|
+
&object.method(:method).</p>
|
647
|
+
|
648
|
+
|
649
|
+
</div>
|
650
|
+
</div>
|
651
|
+
<div class="tags">
|
652
|
+
|
653
|
+
<p class="tag_title">Yields:</p>
|
654
|
+
<ul class="yield">
|
655
|
+
|
656
|
+
<li>
|
657
|
+
|
658
|
+
|
659
|
+
<span class='type'>(<tt>Exception</tt>, <tt>self</tt>)</span>
|
660
|
+
|
661
|
+
|
662
|
+
|
663
|
+
</li>
|
664
|
+
|
665
|
+
</ul>
|
666
|
+
<p class="tag_title">Returns:</p>
|
667
|
+
<ul class="return">
|
668
|
+
|
669
|
+
<li>
|
670
|
+
|
671
|
+
|
672
|
+
<span class='type'>(<tt>Block</tt>)</span>
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
—
|
677
|
+
<div class='inline'>
|
678
|
+
<p>a reference to the given block.</p>
|
679
|
+
</div>
|
680
|
+
|
681
|
+
</li>
|
682
|
+
|
683
|
+
</ul>
|
684
|
+
|
685
|
+
</div><table class="source_code">
|
686
|
+
<tr>
|
687
|
+
<td>
|
688
|
+
<pre class="lines">
|
689
|
+
|
690
|
+
|
691
|
+
59
|
692
|
+
60
|
693
|
+
61
|
694
|
+
62
|
695
|
+
63</pre>
|
696
|
+
</td>
|
697
|
+
<td>
|
698
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/managed_socket.rb', line 59</span>
|
699
|
+
|
700
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_register_error_handler'>register_error_handler</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
701
|
+
<span class='ivar'>@error_handlers</span> <span class='op'><<</span> <span class='id identifier rubyid_block'>block</span> <span class='kw'>unless</span> <span class='ivar'>@error_handlers</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_block'>block</span>
|
702
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_register_error_handler'>register_error_handler</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span> <span class='kw'>if</span> <span class='ivar'>@socket</span>
|
703
|
+
<span class='id identifier rubyid_block'>block</span>
|
704
|
+
<span class='kw'>end</span></pre>
|
705
|
+
</td>
|
706
|
+
</tr>
|
707
|
+
</table>
|
708
|
+
</div>
|
709
|
+
|
710
|
+
<div class="method_details ">
|
711
|
+
<h3 class="signature " id="register_match_handler-instance_method">
|
712
|
+
|
713
|
+
- (<tt>Block</tt>) <strong>register_match_handler</strong> {|MatchData, self| ... }
|
714
|
+
|
715
|
+
|
716
|
+
|
717
|
+
<span class="aliases">Also known as:
|
718
|
+
<span class="names"><span id='on_match-instance_method'>on_match</span></span>
|
719
|
+
</span>
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
</h3><div class="docstring">
|
724
|
+
<div class="discussion">
|
725
|
+
|
726
|
+
<p>Register a block to be called when <span class='object_link'><a href="Extension/IO.html#run_match-instance_method" title="Ionian::Extension::IO#run_match (method)">Extension::IO#run_match</a></span>
|
727
|
+
receives matched data. Method callbacks can be registered with
|
728
|
+
&object.method(:method).</p>
|
729
|
+
|
730
|
+
|
731
|
+
</div>
|
732
|
+
</div>
|
733
|
+
<div class="tags">
|
734
|
+
|
735
|
+
<p class="tag_title">Yields:</p>
|
736
|
+
<ul class="yield">
|
737
|
+
|
738
|
+
<li>
|
739
|
+
|
740
|
+
|
741
|
+
<span class='type'>(<tt>MatchData</tt>, <tt>self</tt>)</span>
|
742
|
+
|
743
|
+
|
744
|
+
|
745
|
+
</li>
|
746
|
+
|
747
|
+
</ul>
|
748
|
+
<p class="tag_title">Returns:</p>
|
749
|
+
<ul class="return">
|
750
|
+
|
751
|
+
<li>
|
752
|
+
|
753
|
+
|
754
|
+
<span class='type'>(<tt>Block</tt>)</span>
|
755
|
+
|
756
|
+
|
757
|
+
|
758
|
+
—
|
759
|
+
<div class='inline'>
|
760
|
+
<p>The given block.</p>
|
761
|
+
</div>
|
762
|
+
|
763
|
+
</li>
|
764
|
+
|
765
|
+
</ul>
|
766
|
+
|
767
|
+
</div><table class="source_code">
|
768
|
+
<tr>
|
769
|
+
<td>
|
770
|
+
<pre class="lines">
|
771
|
+
|
772
|
+
|
773
|
+
39
|
774
|
+
40
|
775
|
+
41
|
776
|
+
42
|
777
|
+
43</pre>
|
778
|
+
</td>
|
779
|
+
<td>
|
780
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/managed_socket.rb', line 39</span>
|
781
|
+
|
782
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_register_match_handler'>register_match_handler</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
783
|
+
<span class='ivar'>@match_handlers</span> <span class='op'><<</span> <span class='id identifier rubyid_block'>block</span> <span class='kw'>unless</span> <span class='ivar'>@match_handlers</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_block'>block</span>
|
784
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_register_match_handler'>register_match_handler</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span> <span class='kw'>if</span> <span class='ivar'>@socket</span>
|
785
|
+
<span class='id identifier rubyid_block'>block</span>
|
786
|
+
<span class='kw'>end</span></pre>
|
787
|
+
</td>
|
788
|
+
</tr>
|
789
|
+
</table>
|
790
|
+
</div>
|
791
|
+
|
792
|
+
<div class="method_details ">
|
793
|
+
<h3 class="signature " id="respond_to_missing?-instance_method">
|
794
|
+
|
795
|
+
- (<tt>Boolean</tt>) <strong>respond_to_missing?</strong>(meth, *args)
|
796
|
+
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
</h3><div class="docstring">
|
802
|
+
<div class="discussion">
|
803
|
+
|
804
|
+
|
805
|
+
</div>
|
806
|
+
</div>
|
807
|
+
<div class="tags">
|
808
|
+
|
809
|
+
<p class="tag_title">Returns:</p>
|
810
|
+
<ul class="return">
|
811
|
+
|
812
|
+
<li>
|
813
|
+
|
814
|
+
|
815
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
816
|
+
|
817
|
+
|
818
|
+
|
819
|
+
</li>
|
820
|
+
|
821
|
+
</ul>
|
822
|
+
|
823
|
+
</div><table class="source_code">
|
824
|
+
<tr>
|
825
|
+
<td>
|
826
|
+
<pre class="lines">
|
827
|
+
|
828
|
+
|
829
|
+
81
|
830
|
+
82
|
831
|
+
83</pre>
|
832
|
+
</td>
|
833
|
+
<td>
|
834
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/managed_socket.rb', line 81</span>
|
835
|
+
|
836
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_respond_to_missing?'>respond_to_missing?</span> <span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span>
|
837
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span>
|
838
|
+
<span class='kw'>end</span></pre>
|
839
|
+
</td>
|
840
|
+
</tr>
|
841
|
+
</table>
|
842
|
+
</div>
|
843
|
+
|
844
|
+
<div class="method_details ">
|
845
|
+
<h3 class="signature " id="unregister_error_handler-instance_method">
|
846
|
+
|
847
|
+
- (<tt>Object</tt>) <strong>unregister_error_handler</strong>(&block)
|
848
|
+
|
849
|
+
|
850
|
+
|
851
|
+
|
852
|
+
|
853
|
+
</h3><div class="docstring">
|
854
|
+
<div class="discussion">
|
855
|
+
|
856
|
+
<p>Unregister a block from being called when a IO#run_match error is
|
857
|
+
raised.</p>
|
858
|
+
|
859
|
+
|
860
|
+
</div>
|
861
|
+
</div>
|
862
|
+
<div class="tags">
|
863
|
+
|
864
|
+
|
865
|
+
</div><table class="source_code">
|
866
|
+
<tr>
|
867
|
+
<td>
|
868
|
+
<pre class="lines">
|
869
|
+
|
870
|
+
|
871
|
+
69
|
872
|
+
70
|
873
|
+
71
|
874
|
+
72
|
875
|
+
73</pre>
|
876
|
+
</td>
|
877
|
+
<td>
|
878
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/managed_socket.rb', line 69</span>
|
879
|
+
|
880
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_unregister_error_handler'>unregister_error_handler</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
881
|
+
<span class='ivar'>@error_handlers</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_o'>o</span><span class='op'>|</span> <span class='id identifier rubyid_o'>o</span> <span class='op'>==</span> <span class='id identifier rubyid_block'>block</span> <span class='rbrace'>}</span>
|
882
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_unregister_error_handler'>unregister_error_handler</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span> <span class='kw'>if</span> <span class='ivar'>@socket</span>
|
883
|
+
<span class='id identifier rubyid_block'>block</span>
|
884
|
+
<span class='kw'>end</span></pre>
|
885
|
+
</td>
|
886
|
+
</tr>
|
887
|
+
</table>
|
888
|
+
</div>
|
889
|
+
|
890
|
+
<div class="method_details ">
|
891
|
+
<h3 class="signature " id="unregister_match_handler-instance_method">
|
892
|
+
|
893
|
+
- (<tt>Object</tt>) <strong>unregister_match_handler</strong>(&block)
|
894
|
+
|
895
|
+
|
896
|
+
|
897
|
+
|
898
|
+
|
899
|
+
</h3><div class="docstring">
|
900
|
+
<div class="discussion">
|
901
|
+
|
902
|
+
<p>Unregister a block from being called when matched data is received.</p>
|
903
|
+
|
904
|
+
|
905
|
+
</div>
|
906
|
+
</div>
|
907
|
+
<div class="tags">
|
908
|
+
|
909
|
+
|
910
|
+
</div><table class="source_code">
|
911
|
+
<tr>
|
912
|
+
<td>
|
913
|
+
<pre class="lines">
|
914
|
+
|
915
|
+
|
916
|
+
48
|
917
|
+
49
|
918
|
+
50
|
919
|
+
51
|
920
|
+
52</pre>
|
921
|
+
</td>
|
922
|
+
<td>
|
923
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/managed_socket.rb', line 48</span>
|
924
|
+
|
925
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_unregister_match_handler'>unregister_match_handler</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
926
|
+
<span class='ivar'>@match_handlers</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_o'>o</span><span class='op'>|</span> <span class='id identifier rubyid_o'>o</span> <span class='op'>==</span> <span class='id identifier rubyid_block'>block</span> <span class='rbrace'>}</span>
|
927
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_unregister_match_handler'>unregister_match_handler</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span> <span class='kw'>if</span> <span class='ivar'>@socket</span>
|
928
|
+
<span class='id identifier rubyid_block'>block</span>
|
929
|
+
<span class='kw'>end</span></pre>
|
930
|
+
</td>
|
931
|
+
</tr>
|
932
|
+
</table>
|
933
|
+
</div>
|
934
|
+
|
935
|
+
</div>
|
936
|
+
|
937
|
+
</div>
|
938
|
+
|
939
|
+
<div id="footer">
|
940
|
+
Generated on Wed Jan 28 16:07:21 2015 by
|
941
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
942
|
+
0.8.7.6 (ruby-2.1.5).
|
943
|
+
</div>
|
944
|
+
|
945
|
+
</body>
|
946
|
+
</html>
|