isimud 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.yardoc/checksums +15 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +23 -0
- data/Gemfile.lock +123 -0
- data/README.md +218 -0
- data/Rakefile +2 -0
- data/config.ru +7 -0
- data/config/tddium.yml +11 -0
- data/doc/Isimud.html +1696 -0
- data/doc/Isimud/BunnyClient.html +1004 -0
- data/doc/Isimud/Client.html +812 -0
- data/doc/Isimud/Event.html +1500 -0
- data/doc/Isimud/EventListener.html +1217 -0
- data/doc/Isimud/EventObserver.html +367 -0
- data/doc/Isimud/EventObserver/ClassMethods.html +292 -0
- data/doc/Isimud/Generators.html +117 -0
- data/doc/Isimud/Generators/ConfigGenerator.html +192 -0
- data/doc/Isimud/Generators/InitializerGenerator.html +192 -0
- data/doc/Isimud/Logging.html +230 -0
- data/doc/Isimud/ModelWatcher.html +312 -0
- data/doc/Isimud/ModelWatcher/ClassMethods.html +511 -0
- data/doc/Isimud/Railtie.html +123 -0
- data/doc/Isimud/TestClient.html +1003 -0
- data/doc/Isimud/TestClient/Queue.html +556 -0
- data/doc/_index.html +290 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +338 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +338 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +711 -0
- data/doc/top-level-namespace.html +112 -0
- data/isimud.gemspec +25 -0
- data/lib/isimud.rb +91 -0
- data/lib/isimud/bunny_client.rb +95 -0
- data/lib/isimud/client.rb +48 -0
- data/lib/isimud/event.rb +112 -0
- data/lib/isimud/event_listener.rb +200 -0
- data/lib/isimud/event_observer.rb +81 -0
- data/lib/isimud/logging.rb +11 -0
- data/lib/isimud/model_watcher.rb +144 -0
- data/lib/isimud/railtie.rb +9 -0
- data/lib/isimud/tasks.rb +20 -0
- data/lib/isimud/test_client.rb +89 -0
- data/lib/isimud/version.rb +3 -0
- data/lib/rails/generators/isimud/config_generator.rb +12 -0
- data/lib/rails/generators/isimud/initializer_generator.rb +12 -0
- data/lib/rails/generators/isimud/templates/initializer.rb +17 -0
- data/lib/rails/generators/isimud/templates/isimud.yml +20 -0
- data/spec/internal/app/models/admin.rb +2 -0
- data/spec/internal/app/models/company.rb +34 -0
- data/spec/internal/app/models/user.rb +27 -0
- data/spec/internal/config/database.yml +3 -0
- data/spec/internal/config/routes.rb +3 -0
- data/spec/internal/db/schema.rb +22 -0
- data/spec/internal/log/.gitignore +1 -0
- data/spec/internal/public/favicon.ico +0 -0
- data/spec/isimud/bunny_client_spec.rb +125 -0
- data/spec/isimud/event_listener_spec.rb +86 -0
- data/spec/isimud/event_observer_spec.rb +32 -0
- data/spec/isimud/event_spec.rb +74 -0
- data/spec/isimud/model_watcher_spec.rb +189 -0
- data/spec/isimud/test_client_spec.rb +28 -0
- data/spec/isimud_spec.rb +49 -0
- data/spec/spec_helper.rb +55 -0
- metadata +195 -0
@@ -0,0 +1,1217 @@
|
|
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: Isimud::EventListener
|
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#!Isimud/EventListener.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 (E)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Isimud.html" title="Isimud (module)">Isimud</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">EventListener</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: Isimud::EventListener
|
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">Isimud::EventListener</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<dt class="r2">Includes:</dt>
|
94
|
+
<dd class="r2"><span class='object_link'><a href="Logging.html" title="Isimud::Logging (module)">Logging</a></span></dd>
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dt class="r1 last">Defined in:</dt>
|
101
|
+
<dd class="r1 last">lib/isimud/event_listener.rb</dd>
|
102
|
+
|
103
|
+
</dl>
|
104
|
+
<div class="clear"></div>
|
105
|
+
|
106
|
+
|
107
|
+
<h2>Constant Summary</h2>
|
108
|
+
|
109
|
+
<dl class="constants">
|
110
|
+
|
111
|
+
<dt id="DEFAULT_ERROR_LIMIT-constant" class="">DEFAULT_ERROR_LIMIT =
|
112
|
+
|
113
|
+
</dt>
|
114
|
+
<dd><pre class="code"><span class='int'>100</span></pre></dd>
|
115
|
+
|
116
|
+
<dt id="DEFAULT_ERROR_INTERVAL-constant" class="">DEFAULT_ERROR_INTERVAL =
|
117
|
+
|
118
|
+
</dt>
|
119
|
+
<dd><pre class="code"><span class='int'>3600</span></pre></dd>
|
120
|
+
|
121
|
+
<dt id="DEFAULT_EVENTS_EXCHANGE-constant" class="">DEFAULT_EVENTS_EXCHANGE =
|
122
|
+
|
123
|
+
</dt>
|
124
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>events</span><span class='tstring_end'>'</span></span></pre></dd>
|
125
|
+
|
126
|
+
<dt id="DEFAULT_MODELS_EXCHANGE-constant" class="">DEFAULT_MODELS_EXCHANGE =
|
127
|
+
|
128
|
+
</dt>
|
129
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>models</span><span class='tstring_end'>'</span></span></pre></dd>
|
130
|
+
|
131
|
+
</dl>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
138
|
+
<ul class="summary">
|
139
|
+
|
140
|
+
<li class="public ">
|
141
|
+
<span class="summary_signature">
|
142
|
+
|
143
|
+
<a href="#error_count-instance_method" title="#error_count (instance method)">- (Object) <strong>error_count</strong> </a>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
</span>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<span class="note title readonly">readonly</span>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<span class="summary_desc"><div class='inline'>
|
163
|
+
<p>Returns the value of attribute error_count.</p>
|
164
|
+
</div></span>
|
165
|
+
|
166
|
+
</li>
|
167
|
+
|
168
|
+
|
169
|
+
<li class="public ">
|
170
|
+
<span class="summary_signature">
|
171
|
+
|
172
|
+
<a href="#error_interval-instance_method" title="#error_interval (instance method)">- (Object) <strong>error_interval</strong> </a>
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
</span>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<span class="note title readonly">readonly</span>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
<span class="summary_desc"><div class='inline'>
|
192
|
+
<p>Returns the value of attribute error_interval.</p>
|
193
|
+
</div></span>
|
194
|
+
|
195
|
+
</li>
|
196
|
+
|
197
|
+
|
198
|
+
<li class="public ">
|
199
|
+
<span class="summary_signature">
|
200
|
+
|
201
|
+
<a href="#error_limit-instance_method" title="#error_limit (instance method)">- (Object) <strong>error_limit</strong> </a>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
</span>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<span class="note title readonly">readonly</span>
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
<span class="summary_desc"><div class='inline'>
|
221
|
+
<p>Returns the value of attribute error_limit.</p>
|
222
|
+
</div></span>
|
223
|
+
|
224
|
+
</li>
|
225
|
+
|
226
|
+
|
227
|
+
<li class="public ">
|
228
|
+
<span class="summary_signature">
|
229
|
+
|
230
|
+
<a href="#events_exchange-instance_method" title="#events_exchange (instance method)">- (Object) <strong>events_exchange</strong> </a>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
</span>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
<span class="note title readonly">readonly</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<span class="summary_desc"><div class='inline'>
|
250
|
+
<p>Returns the value of attribute events_exchange.</p>
|
251
|
+
</div></span>
|
252
|
+
|
253
|
+
</li>
|
254
|
+
|
255
|
+
|
256
|
+
<li class="public ">
|
257
|
+
<span class="summary_signature">
|
258
|
+
|
259
|
+
<a href="#models_exchange-instance_method" title="#models_exchange (instance method)">- (Object) <strong>models_exchange</strong> </a>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
</span>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
<span class="note title readonly">readonly</span>
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
<span class="summary_desc"><div class='inline'>
|
279
|
+
<p>Returns the value of attribute models_exchange.</p>
|
280
|
+
</div></span>
|
281
|
+
|
282
|
+
</li>
|
283
|
+
|
284
|
+
|
285
|
+
<li class="public ">
|
286
|
+
<span class="summary_signature">
|
287
|
+
|
288
|
+
<a href="#name-instance_method" title="#name (instance method)">- (Object) <strong>name</strong> </a>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</span>
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<span class="note title readonly">readonly</span>
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
<span class="summary_desc"><div class='inline'>
|
308
|
+
<p>Returns the value of attribute name.</p>
|
309
|
+
</div></span>
|
310
|
+
|
311
|
+
</li>
|
312
|
+
|
313
|
+
|
314
|
+
<li class="public ">
|
315
|
+
<span class="summary_signature">
|
316
|
+
|
317
|
+
<a href="#queues-instance_method" title="#queues (instance method)">- (Object) <strong>queues</strong> </a>
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
</span>
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
<span class="note title readonly">readonly</span>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
<span class="summary_desc"><div class='inline'>
|
337
|
+
<p>Returns the value of attribute queues.</p>
|
338
|
+
</div></span>
|
339
|
+
|
340
|
+
</li>
|
341
|
+
|
342
|
+
|
343
|
+
<li class="public ">
|
344
|
+
<span class="summary_signature">
|
345
|
+
|
346
|
+
<a href="#running-instance_method" title="#running (instance method)">- (Object) <strong>running</strong> </a>
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
</span>
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
<span class="note title readonly">readonly</span>
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
<span class="summary_desc"><div class='inline'>
|
366
|
+
<p>Returns the value of attribute running.</p>
|
367
|
+
</div></span>
|
368
|
+
|
369
|
+
</li>
|
370
|
+
|
371
|
+
|
372
|
+
</ul>
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
<h2>
|
379
|
+
Instance Method Summary
|
380
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
381
|
+
</h2>
|
382
|
+
|
383
|
+
<ul class="summary">
|
384
|
+
|
385
|
+
<li class="public ">
|
386
|
+
<span class="summary_signature">
|
387
|
+
|
388
|
+
<a href="#bind_queues-instance_method" title="#bind_queues (instance method)">- (Object) <strong>bind_queues</strong> </a>
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
</span>
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
<span class="summary_desc"><div class='inline'>
|
403
|
+
<p>Override this method to set up message observers.</p>
|
404
|
+
</div></span>
|
405
|
+
|
406
|
+
</li>
|
407
|
+
|
408
|
+
|
409
|
+
<li class="public ">
|
410
|
+
<span class="summary_signature">
|
411
|
+
|
412
|
+
<a href="#has_observer%3F-instance_method" title="#has_observer? (instance method)">- (Boolean) <strong>has_observer?</strong>(observer) </a>
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
</span>
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
427
|
+
|
428
|
+
</li>
|
429
|
+
|
430
|
+
|
431
|
+
<li class="public ">
|
432
|
+
<span class="summary_signature">
|
433
|
+
|
434
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (EventListener) <strong>initialize</strong>(options = {}) </a>
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
</span>
|
439
|
+
|
440
|
+
|
441
|
+
<span class="note title constructor">constructor</span>
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
<span class="summary_desc"><div class='inline'>
|
451
|
+
<p>A new instance of EventListener.</p>
|
452
|
+
</div></span>
|
453
|
+
|
454
|
+
</li>
|
455
|
+
|
456
|
+
|
457
|
+
<li class="public ">
|
458
|
+
<span class="summary_signature">
|
459
|
+
|
460
|
+
<a href="#max_errors-instance_method" title="#max_errors (instance method)">- (Object) <strong>max_errors</strong> </a>
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
</span>
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
475
|
+
|
476
|
+
</li>
|
477
|
+
|
478
|
+
|
479
|
+
<li class="public ">
|
480
|
+
<span class="summary_signature">
|
481
|
+
|
482
|
+
<a href="#run-instance_method" title="#run (instance method)">- (Object) <strong>run</strong> </a>
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
</span>
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
497
|
+
|
498
|
+
</li>
|
499
|
+
|
500
|
+
|
501
|
+
<li class="public ">
|
502
|
+
<span class="summary_signature">
|
503
|
+
|
504
|
+
<a href="#test_env%3F-instance_method" title="#test_env? (instance method)">- (Boolean) <strong>test_env?</strong> </a>
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
</span>
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
519
|
+
|
520
|
+
</li>
|
521
|
+
|
522
|
+
|
523
|
+
</ul>
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Logging.html" title="Isimud::Logging (module)">Logging</a></span></h3>
|
536
|
+
<p class="inherited"><span class='object_link'><a href="Logging.html#log-instance_method" title="Isimud::Logging#log (method)">#log</a></span>, <span class='object_link'><a href="Logging.html#logger-instance_method" title="Isimud::Logging#logger (method)">#logger</a></span></p>
|
537
|
+
<div id="constructor_details" class="method_details_list">
|
538
|
+
<h2>Constructor Details</h2>
|
539
|
+
|
540
|
+
<div class="method_details first">
|
541
|
+
<h3 class="signature first" id="initialize-instance_method">
|
542
|
+
|
543
|
+
- (<tt><span class='object_link'><a href="" title="Isimud::EventListener (class)">EventListener</a></span></tt>) <strong>initialize</strong>(options = {})
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
</h3><div class="docstring">
|
550
|
+
<div class="discussion">
|
551
|
+
|
552
|
+
<p>Returns a new instance of EventListener</p>
|
553
|
+
|
554
|
+
|
555
|
+
</div>
|
556
|
+
</div>
|
557
|
+
<div class="tags">
|
558
|
+
|
559
|
+
|
560
|
+
</div><table class="source_code">
|
561
|
+
<tr>
|
562
|
+
<td>
|
563
|
+
<pre class="lines">
|
564
|
+
|
565
|
+
|
566
|
+
16
|
567
|
+
17
|
568
|
+
18
|
569
|
+
19
|
570
|
+
20
|
571
|
+
21
|
572
|
+
22
|
573
|
+
23
|
574
|
+
24
|
575
|
+
25
|
576
|
+
26
|
577
|
+
27
|
578
|
+
28
|
579
|
+
29
|
580
|
+
30
|
581
|
+
31
|
582
|
+
32
|
583
|
+
33
|
584
|
+
34
|
585
|
+
35</pre>
|
586
|
+
</td>
|
587
|
+
<td>
|
588
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 16</span>
|
589
|
+
|
590
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
591
|
+
<span class='id identifier rubyid_default_options'>default_options</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
592
|
+
<span class='label'>error_limit:</span> <span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_listener_error_limit'>listener_error_limit</span> <span class='op'>||</span> <span class='const'>DEFAULT_ERROR_LIMIT</span><span class='comma'>,</span>
|
593
|
+
<span class='label'>error_interval:</span> <span class='const'>DEFAULT_ERROR_INTERVAL</span><span class='comma'>,</span>
|
594
|
+
<span class='label'>events_exchange:</span> <span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_events_exchange'>events_exchange</span> <span class='op'>||</span> <span class='const'>DEFAULT_EVENTS_EXCHANGE</span><span class='comma'>,</span>
|
595
|
+
<span class='label'>models_exchange:</span> <span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_model_watcher_exchange'>model_watcher_exchange</span> <span class='op'>||</span> <span class='const'>DEFAULT_MODELS_EXCHANGE</span><span class='comma'>,</span>
|
596
|
+
<span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_parent_name'>parent_name</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='embexpr_end'>}</span><span class='tstring_content'>-listener</span><span class='tstring_end'>"</span></span>
|
597
|
+
<span class='rbrace'>}</span>
|
598
|
+
<span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_reverse_merge!'>reverse_merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_default_options'>default_options</span><span class='rparen'>)</span>
|
599
|
+
<span class='ivar'>@error_count</span> <span class='op'>=</span> <span class='int'>0</span>
|
600
|
+
<span class='ivar'>@observers</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
601
|
+
<span class='ivar'>@observed_models</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
602
|
+
<span class='ivar'>@events_exchange</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:events_exchange</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>DEFAULT_EVENTS_EXCHANGE</span>
|
603
|
+
<span class='ivar'>@models_exchange</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:models_exchange</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>DEFAULT_MODELS_EXCHANGE</span>
|
604
|
+
<span class='ivar'>@error_limit</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:error_limit</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>DEFAULT_ERROR_LIMIT</span>
|
605
|
+
<span class='ivar'>@error_interval</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:error_interval</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>DEFAULT_ERROR_INTERVAL</span>
|
606
|
+
<span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span>
|
607
|
+
<span class='ivar'>@observer_mutex</span> <span class='op'>=</span> <span class='const'>Mutex</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
608
|
+
<span class='ivar'>@running</span> <span class='op'>=</span> <span class='kw'>false</span>
|
609
|
+
<span class='kw'>end</span></pre>
|
610
|
+
</td>
|
611
|
+
</tr>
|
612
|
+
</table>
|
613
|
+
</div>
|
614
|
+
|
615
|
+
</div>
|
616
|
+
|
617
|
+
<div id="instance_attr_details" class="attr_details">
|
618
|
+
<h2>Instance Attribute Details</h2>
|
619
|
+
|
620
|
+
|
621
|
+
<span id=""></span>
|
622
|
+
<div class="method_details first">
|
623
|
+
<h3 class="signature first" id="error_count-instance_method">
|
624
|
+
|
625
|
+
- (<tt>Object</tt>) <strong>error_count</strong> <span class="extras">(readonly)</span>
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
</h3><div class="docstring">
|
632
|
+
<div class="discussion">
|
633
|
+
|
634
|
+
<p>Returns the value of attribute error_count</p>
|
635
|
+
|
636
|
+
|
637
|
+
</div>
|
638
|
+
</div>
|
639
|
+
<div class="tags">
|
640
|
+
|
641
|
+
|
642
|
+
</div><table class="source_code">
|
643
|
+
<tr>
|
644
|
+
<td>
|
645
|
+
<pre class="lines">
|
646
|
+
|
647
|
+
|
648
|
+
7
|
649
|
+
8
|
650
|
+
9</pre>
|
651
|
+
</td>
|
652
|
+
<td>
|
653
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 7</span>
|
654
|
+
|
655
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_count'>error_count</span>
|
656
|
+
<span class='ivar'>@error_count</span>
|
657
|
+
<span class='kw'>end</span></pre>
|
658
|
+
</td>
|
659
|
+
</tr>
|
660
|
+
</table>
|
661
|
+
</div>
|
662
|
+
|
663
|
+
|
664
|
+
<span id=""></span>
|
665
|
+
<div class="method_details ">
|
666
|
+
<h3 class="signature " id="error_interval-instance_method">
|
667
|
+
|
668
|
+
- (<tt>Object</tt>) <strong>error_interval</strong> <span class="extras">(readonly)</span>
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
</h3><div class="docstring">
|
675
|
+
<div class="discussion">
|
676
|
+
|
677
|
+
<p>Returns the value of attribute error_interval</p>
|
678
|
+
|
679
|
+
|
680
|
+
</div>
|
681
|
+
</div>
|
682
|
+
<div class="tags">
|
683
|
+
|
684
|
+
|
685
|
+
</div><table class="source_code">
|
686
|
+
<tr>
|
687
|
+
<td>
|
688
|
+
<pre class="lines">
|
689
|
+
|
690
|
+
|
691
|
+
7
|
692
|
+
8
|
693
|
+
9</pre>
|
694
|
+
</td>
|
695
|
+
<td>
|
696
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 7</span>
|
697
|
+
|
698
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_interval'>error_interval</span>
|
699
|
+
<span class='ivar'>@error_interval</span>
|
700
|
+
<span class='kw'>end</span></pre>
|
701
|
+
</td>
|
702
|
+
</tr>
|
703
|
+
</table>
|
704
|
+
</div>
|
705
|
+
|
706
|
+
|
707
|
+
<span id=""></span>
|
708
|
+
<div class="method_details ">
|
709
|
+
<h3 class="signature " id="error_limit-instance_method">
|
710
|
+
|
711
|
+
- (<tt>Object</tt>) <strong>error_limit</strong> <span class="extras">(readonly)</span>
|
712
|
+
|
713
|
+
|
714
|
+
|
715
|
+
|
716
|
+
|
717
|
+
</h3><div class="docstring">
|
718
|
+
<div class="discussion">
|
719
|
+
|
720
|
+
<p>Returns the value of attribute error_limit</p>
|
721
|
+
|
722
|
+
|
723
|
+
</div>
|
724
|
+
</div>
|
725
|
+
<div class="tags">
|
726
|
+
|
727
|
+
|
728
|
+
</div><table class="source_code">
|
729
|
+
<tr>
|
730
|
+
<td>
|
731
|
+
<pre class="lines">
|
732
|
+
|
733
|
+
|
734
|
+
7
|
735
|
+
8
|
736
|
+
9</pre>
|
737
|
+
</td>
|
738
|
+
<td>
|
739
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 7</span>
|
740
|
+
|
741
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_limit'>error_limit</span>
|
742
|
+
<span class='ivar'>@error_limit</span>
|
743
|
+
<span class='kw'>end</span></pre>
|
744
|
+
</td>
|
745
|
+
</tr>
|
746
|
+
</table>
|
747
|
+
</div>
|
748
|
+
|
749
|
+
|
750
|
+
<span id=""></span>
|
751
|
+
<div class="method_details ">
|
752
|
+
<h3 class="signature " id="events_exchange-instance_method">
|
753
|
+
|
754
|
+
- (<tt>Object</tt>) <strong>events_exchange</strong> <span class="extras">(readonly)</span>
|
755
|
+
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
</h3><div class="docstring">
|
761
|
+
<div class="discussion">
|
762
|
+
|
763
|
+
<p>Returns the value of attribute events_exchange</p>
|
764
|
+
|
765
|
+
|
766
|
+
</div>
|
767
|
+
</div>
|
768
|
+
<div class="tags">
|
769
|
+
|
770
|
+
|
771
|
+
</div><table class="source_code">
|
772
|
+
<tr>
|
773
|
+
<td>
|
774
|
+
<pre class="lines">
|
775
|
+
|
776
|
+
|
777
|
+
7
|
778
|
+
8
|
779
|
+
9</pre>
|
780
|
+
</td>
|
781
|
+
<td>
|
782
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 7</span>
|
783
|
+
|
784
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_events_exchange'>events_exchange</span>
|
785
|
+
<span class='ivar'>@events_exchange</span>
|
786
|
+
<span class='kw'>end</span></pre>
|
787
|
+
</td>
|
788
|
+
</tr>
|
789
|
+
</table>
|
790
|
+
</div>
|
791
|
+
|
792
|
+
|
793
|
+
<span id=""></span>
|
794
|
+
<div class="method_details ">
|
795
|
+
<h3 class="signature " id="models_exchange-instance_method">
|
796
|
+
|
797
|
+
- (<tt>Object</tt>) <strong>models_exchange</strong> <span class="extras">(readonly)</span>
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
|
802
|
+
|
803
|
+
</h3><div class="docstring">
|
804
|
+
<div class="discussion">
|
805
|
+
|
806
|
+
<p>Returns the value of attribute models_exchange</p>
|
807
|
+
|
808
|
+
|
809
|
+
</div>
|
810
|
+
</div>
|
811
|
+
<div class="tags">
|
812
|
+
|
813
|
+
|
814
|
+
</div><table class="source_code">
|
815
|
+
<tr>
|
816
|
+
<td>
|
817
|
+
<pre class="lines">
|
818
|
+
|
819
|
+
|
820
|
+
7
|
821
|
+
8
|
822
|
+
9</pre>
|
823
|
+
</td>
|
824
|
+
<td>
|
825
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 7</span>
|
826
|
+
|
827
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_models_exchange'>models_exchange</span>
|
828
|
+
<span class='ivar'>@models_exchange</span>
|
829
|
+
<span class='kw'>end</span></pre>
|
830
|
+
</td>
|
831
|
+
</tr>
|
832
|
+
</table>
|
833
|
+
</div>
|
834
|
+
|
835
|
+
|
836
|
+
<span id=""></span>
|
837
|
+
<div class="method_details ">
|
838
|
+
<h3 class="signature " id="name-instance_method">
|
839
|
+
|
840
|
+
- (<tt>Object</tt>) <strong>name</strong> <span class="extras">(readonly)</span>
|
841
|
+
|
842
|
+
|
843
|
+
|
844
|
+
|
845
|
+
|
846
|
+
</h3><div class="docstring">
|
847
|
+
<div class="discussion">
|
848
|
+
|
849
|
+
<p>Returns the value of attribute name</p>
|
850
|
+
|
851
|
+
|
852
|
+
</div>
|
853
|
+
</div>
|
854
|
+
<div class="tags">
|
855
|
+
|
856
|
+
|
857
|
+
</div><table class="source_code">
|
858
|
+
<tr>
|
859
|
+
<td>
|
860
|
+
<pre class="lines">
|
861
|
+
|
862
|
+
|
863
|
+
7
|
864
|
+
8
|
865
|
+
9</pre>
|
866
|
+
</td>
|
867
|
+
<td>
|
868
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 7</span>
|
869
|
+
|
870
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
871
|
+
<span class='ivar'>@name</span>
|
872
|
+
<span class='kw'>end</span></pre>
|
873
|
+
</td>
|
874
|
+
</tr>
|
875
|
+
</table>
|
876
|
+
</div>
|
877
|
+
|
878
|
+
|
879
|
+
<span id=""></span>
|
880
|
+
<div class="method_details ">
|
881
|
+
<h3 class="signature " id="queues-instance_method">
|
882
|
+
|
883
|
+
- (<tt>Object</tt>) <strong>queues</strong> <span class="extras">(readonly)</span>
|
884
|
+
|
885
|
+
|
886
|
+
|
887
|
+
|
888
|
+
|
889
|
+
</h3><div class="docstring">
|
890
|
+
<div class="discussion">
|
891
|
+
|
892
|
+
<p>Returns the value of attribute queues</p>
|
893
|
+
|
894
|
+
|
895
|
+
</div>
|
896
|
+
</div>
|
897
|
+
<div class="tags">
|
898
|
+
|
899
|
+
|
900
|
+
</div><table class="source_code">
|
901
|
+
<tr>
|
902
|
+
<td>
|
903
|
+
<pre class="lines">
|
904
|
+
|
905
|
+
|
906
|
+
7
|
907
|
+
8
|
908
|
+
9</pre>
|
909
|
+
</td>
|
910
|
+
<td>
|
911
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 7</span>
|
912
|
+
|
913
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_queues'>queues</span>
|
914
|
+
<span class='ivar'>@queues</span>
|
915
|
+
<span class='kw'>end</span></pre>
|
916
|
+
</td>
|
917
|
+
</tr>
|
918
|
+
</table>
|
919
|
+
</div>
|
920
|
+
|
921
|
+
|
922
|
+
<span id=""></span>
|
923
|
+
<div class="method_details ">
|
924
|
+
<h3 class="signature " id="running-instance_method">
|
925
|
+
|
926
|
+
- (<tt>Object</tt>) <strong>running</strong> <span class="extras">(readonly)</span>
|
927
|
+
|
928
|
+
|
929
|
+
|
930
|
+
|
931
|
+
|
932
|
+
</h3><div class="docstring">
|
933
|
+
<div class="discussion">
|
934
|
+
|
935
|
+
<p>Returns the value of attribute running</p>
|
936
|
+
|
937
|
+
|
938
|
+
</div>
|
939
|
+
</div>
|
940
|
+
<div class="tags">
|
941
|
+
|
942
|
+
|
943
|
+
</div><table class="source_code">
|
944
|
+
<tr>
|
945
|
+
<td>
|
946
|
+
<pre class="lines">
|
947
|
+
|
948
|
+
|
949
|
+
7
|
950
|
+
8
|
951
|
+
9</pre>
|
952
|
+
</td>
|
953
|
+
<td>
|
954
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 7</span>
|
955
|
+
|
956
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_running'>running</span>
|
957
|
+
<span class='ivar'>@running</span>
|
958
|
+
<span class='kw'>end</span></pre>
|
959
|
+
</td>
|
960
|
+
</tr>
|
961
|
+
</table>
|
962
|
+
</div>
|
963
|
+
|
964
|
+
</div>
|
965
|
+
|
966
|
+
|
967
|
+
<div id="instance_method_details" class="method_details_list">
|
968
|
+
<h2>Instance Method Details</h2>
|
969
|
+
|
970
|
+
|
971
|
+
<div class="method_details first">
|
972
|
+
<h3 class="signature first" id="bind_queues-instance_method">
|
973
|
+
|
974
|
+
- (<tt>Object</tt>) <strong>bind_queues</strong>
|
975
|
+
|
976
|
+
|
977
|
+
|
978
|
+
|
979
|
+
|
980
|
+
</h3><div class="docstring">
|
981
|
+
<div class="discussion">
|
982
|
+
|
983
|
+
<p>Override this method to set up message observers</p>
|
984
|
+
|
985
|
+
|
986
|
+
</div>
|
987
|
+
</div>
|
988
|
+
<div class="tags">
|
989
|
+
|
990
|
+
|
991
|
+
</div><table class="source_code">
|
992
|
+
<tr>
|
993
|
+
<td>
|
994
|
+
<pre class="lines">
|
995
|
+
|
996
|
+
|
997
|
+
61
|
998
|
+
62
|
999
|
+
63
|
1000
|
+
64
|
1001
|
+
65
|
1002
|
+
66
|
1003
|
+
67</pre>
|
1004
|
+
</td>
|
1005
|
+
<td>
|
1006
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 61</span>
|
1007
|
+
|
1008
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_bind_queues'>bind_queues</span>
|
1009
|
+
<span class='const'>EventObserver</span><span class='period'>.</span><span class='id identifier rubyid_observed_models'>observed_models</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_model_class'>model_class</span><span class='op'>|</span>
|
1010
|
+
<span class='id identifier rubyid_model_class'>model_class</span><span class='period'>.</span><span class='id identifier rubyid_find_active_observers'>find_active_observers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_model'>model</span><span class='op'>|</span>
|
1011
|
+
<span class='id identifier rubyid_register_observer'>register_observer</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='rparen'>)</span>
|
1012
|
+
<span class='kw'>end</span>
|
1013
|
+
<span class='kw'>end</span>
|
1014
|
+
<span class='kw'>end</span></pre>
|
1015
|
+
</td>
|
1016
|
+
</tr>
|
1017
|
+
</table>
|
1018
|
+
</div>
|
1019
|
+
|
1020
|
+
<div class="method_details ">
|
1021
|
+
<h3 class="signature " id="has_observer?-instance_method">
|
1022
|
+
|
1023
|
+
- (<tt>Boolean</tt>) <strong>has_observer?</strong>(observer)
|
1024
|
+
|
1025
|
+
|
1026
|
+
|
1027
|
+
|
1028
|
+
|
1029
|
+
</h3><div class="docstring">
|
1030
|
+
<div class="discussion">
|
1031
|
+
|
1032
|
+
|
1033
|
+
</div>
|
1034
|
+
</div>
|
1035
|
+
<div class="tags">
|
1036
|
+
|
1037
|
+
<p class="tag_title">Returns:</p>
|
1038
|
+
<ul class="return">
|
1039
|
+
|
1040
|
+
<li>
|
1041
|
+
|
1042
|
+
|
1043
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1044
|
+
|
1045
|
+
|
1046
|
+
|
1047
|
+
</li>
|
1048
|
+
|
1049
|
+
</ul>
|
1050
|
+
|
1051
|
+
</div><table class="source_code">
|
1052
|
+
<tr>
|
1053
|
+
<td>
|
1054
|
+
<pre class="lines">
|
1055
|
+
|
1056
|
+
|
1057
|
+
69
|
1058
|
+
70
|
1059
|
+
71</pre>
|
1060
|
+
</td>
|
1061
|
+
<td>
|
1062
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 69</span>
|
1063
|
+
|
1064
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_has_observer?'>has_observer?</span><span class='lparen'>(</span><span class='id identifier rubyid_observer'>observer</span><span class='rparen'>)</span>
|
1065
|
+
<span class='ivar'>@observers</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_observer_key_for'>observer_key_for</span><span class='lparen'>(</span><span class='id identifier rubyid_observer'>observer</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='comma'>,</span> <span class='id identifier rubyid_observer'>observer</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1066
|
+
<span class='kw'>end</span></pre>
|
1067
|
+
</td>
|
1068
|
+
</tr>
|
1069
|
+
</table>
|
1070
|
+
</div>
|
1071
|
+
|
1072
|
+
<div class="method_details ">
|
1073
|
+
<h3 class="signature " id="max_errors-instance_method">
|
1074
|
+
|
1075
|
+
- (<tt>Object</tt>) <strong>max_errors</strong>
|
1076
|
+
|
1077
|
+
|
1078
|
+
|
1079
|
+
|
1080
|
+
|
1081
|
+
</h3><table class="source_code">
|
1082
|
+
<tr>
|
1083
|
+
<td>
|
1084
|
+
<pre class="lines">
|
1085
|
+
|
1086
|
+
|
1087
|
+
37
|
1088
|
+
38
|
1089
|
+
39</pre>
|
1090
|
+
</td>
|
1091
|
+
<td>
|
1092
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 37</span>
|
1093
|
+
|
1094
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_max_errors'>max_errors</span>
|
1095
|
+
<span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_listener_error_limit'>listener_error_limit</span> <span class='op'>||</span> <span class='const'>DEFAULT_ERROR_LIMIT</span>
|
1096
|
+
<span class='kw'>end</span></pre>
|
1097
|
+
</td>
|
1098
|
+
</tr>
|
1099
|
+
</table>
|
1100
|
+
</div>
|
1101
|
+
|
1102
|
+
<div class="method_details ">
|
1103
|
+
<h3 class="signature " id="run-instance_method">
|
1104
|
+
|
1105
|
+
- (<tt>Object</tt>) <strong>run</strong>
|
1106
|
+
|
1107
|
+
|
1108
|
+
|
1109
|
+
|
1110
|
+
|
1111
|
+
</h3><table class="source_code">
|
1112
|
+
<tr>
|
1113
|
+
<td>
|
1114
|
+
<pre class="lines">
|
1115
|
+
|
1116
|
+
|
1117
|
+
45
|
1118
|
+
46
|
1119
|
+
47
|
1120
|
+
48
|
1121
|
+
49
|
1122
|
+
50
|
1123
|
+
51
|
1124
|
+
52
|
1125
|
+
53
|
1126
|
+
54
|
1127
|
+
55
|
1128
|
+
56
|
1129
|
+
57
|
1130
|
+
58</pre>
|
1131
|
+
</td>
|
1132
|
+
<td>
|
1133
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 45</span>
|
1134
|
+
|
1135
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
|
1136
|
+
<span class='ivar'>@running</span> <span class='op'>=</span> <span class='kw'>true</span>
|
1137
|
+
<span class='id identifier rubyid_bind_queues'>bind_queues</span> <span class='kw'>and</span> <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_test_env?'>test_env?</span>
|
1138
|
+
<span class='id identifier rubyid_start_shutdown_thread'>start_shutdown_thread</span>
|
1139
|
+
<span class='id identifier rubyid_start_error_counter_thread'>start_error_counter_thread</span>
|
1140
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_connect'>connect</span>
|
1141
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_exception_handler'>exception_handler</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:count_error</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1142
|
+
<span class='id identifier rubyid_start_event_thread'>start_event_thread</span>
|
1143
|
+
|
1144
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>EventListener started. Hit Ctrl-C to exit</span><span class='tstring_end'>'</span></span>
|
1145
|
+
<span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_stop'>stop</span>
|
1146
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Exiting.</span><span class='tstring_end'>'</span></span>
|
1147
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
|
1148
|
+
<span class='kw'>end</span></pre>
|
1149
|
+
</td>
|
1150
|
+
</tr>
|
1151
|
+
</table>
|
1152
|
+
</div>
|
1153
|
+
|
1154
|
+
<div class="method_details ">
|
1155
|
+
<h3 class="signature " id="test_env?-instance_method">
|
1156
|
+
|
1157
|
+
- (<tt>Boolean</tt>) <strong>test_env?</strong>
|
1158
|
+
|
1159
|
+
|
1160
|
+
|
1161
|
+
|
1162
|
+
|
1163
|
+
</h3><div class="docstring">
|
1164
|
+
<div class="discussion">
|
1165
|
+
|
1166
|
+
|
1167
|
+
</div>
|
1168
|
+
</div>
|
1169
|
+
<div class="tags">
|
1170
|
+
|
1171
|
+
<p class="tag_title">Returns:</p>
|
1172
|
+
<ul class="return">
|
1173
|
+
|
1174
|
+
<li>
|
1175
|
+
|
1176
|
+
|
1177
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1178
|
+
|
1179
|
+
|
1180
|
+
|
1181
|
+
</li>
|
1182
|
+
|
1183
|
+
</ul>
|
1184
|
+
|
1185
|
+
</div><table class="source_code">
|
1186
|
+
<tr>
|
1187
|
+
<td>
|
1188
|
+
<pre class="lines">
|
1189
|
+
|
1190
|
+
|
1191
|
+
41
|
1192
|
+
42
|
1193
|
+
43</pre>
|
1194
|
+
</td>
|
1195
|
+
<td>
|
1196
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_listener.rb', line 41</span>
|
1197
|
+
|
1198
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_test_env?'>test_env?</span>
|
1199
|
+
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cucumber</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>test</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
|
1200
|
+
<span class='kw'>end</span></pre>
|
1201
|
+
</td>
|
1202
|
+
</tr>
|
1203
|
+
</table>
|
1204
|
+
</div>
|
1205
|
+
|
1206
|
+
</div>
|
1207
|
+
|
1208
|
+
</div>
|
1209
|
+
|
1210
|
+
<div id="footer">
|
1211
|
+
Generated on Fri Apr 3 09:28:09 2015 by
|
1212
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1213
|
+
0.8.7.6 (ruby-2.2.1).
|
1214
|
+
</div>
|
1215
|
+
|
1216
|
+
</body>
|
1217
|
+
</html>
|