isimud 0.7.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rspec +1 -2
- data/.ruby-version +1 -1
- data/.yardoc/checksums +10 -10
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile +2 -1
- data/Gemfile.lock +63 -73
- data/LICENSE.txt +19 -0
- data/README.md +51 -3
- data/Rakefile +5 -0
- data/doc/Isimud/BunnyClient.html +882 -179
- data/doc/Isimud/Client.html +236 -18
- data/doc/Isimud/Event.html +211 -95
- data/doc/Isimud/EventListener.html +325 -307
- data/doc/Isimud/EventObserver/ClassMethods.html +14 -14
- data/doc/Isimud/EventObserver.html +418 -36
- data/doc/Isimud/Generators/ConfigGenerator.html +2 -2
- data/doc/Isimud/Generators/InitializerGenerator.html +2 -2
- data/doc/Isimud/Generators.html +2 -2
- data/doc/Isimud/Logging.html +3 -3
- data/doc/Isimud/ModelWatcher/ClassMethods.html +3 -3
- data/doc/Isimud/ModelWatcher.html +2 -2
- data/doc/Isimud/Railtie.html +2 -2
- data/doc/Isimud/TestClient/Queue.html +374 -71
- data/doc/Isimud/TestClient.html +169 -161
- data/doc/Isimud.html +80 -76
- data/doc/_index.html +5 -2
- data/doc/file.LICENSE.html +73 -0
- data/doc/file.README.html +131 -7
- data/doc/file_list.html +3 -0
- data/doc/index.html +131 -7
- data/doc/method_list.html +183 -105
- data/doc/top-level-namespace.html +2 -2
- data/isimud.gemspec +18 -16
- data/lib/isimud/bunny_client.rb +85 -32
- data/lib/isimud/client.rb +23 -7
- data/lib/isimud/event.rb +11 -14
- data/lib/isimud/event_listener.rb +123 -65
- data/lib/isimud/event_observer.rb +70 -10
- data/lib/isimud/model_watcher.rb +1 -1
- data/lib/isimud/test_client.rb +54 -26
- data/lib/isimud/version.rb +1 -1
- data/lib/isimud.rb +1 -1
- data/spec/internal/app/models/company.rb +8 -10
- data/spec/internal/app/models/user.rb +11 -1
- data/spec/internal/db/schema.rb +5 -0
- data/spec/isimud/bunny_client_spec.rb +21 -9
- data/spec/isimud/client_spec.rb +40 -0
- data/spec/isimud/event_listener_spec.rb +50 -22
- data/spec/isimud/event_observer_spec.rb +107 -16
- data/spec/isimud/model_watcher_spec.rb +18 -23
- data/spec/isimud/test_client_spec.rb +43 -8
- data/spec/isimud_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -0
- metadata +19 -35
- checksums.yaml.gz.sig +0 -0
- data/certs/gfeil.pem +0 -21
- data/release +0 -31
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -2
@@ -191,12 +191,12 @@
|
|
191
191
|
<pre class="lines">
|
192
192
|
|
193
193
|
|
194
|
-
|
195
|
-
|
196
|
-
|
194
|
+
129
|
195
|
+
130
|
196
|
+
131</pre>
|
197
197
|
</td>
|
198
198
|
<td>
|
199
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line
|
199
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 129</span>
|
200
200
|
|
201
201
|
<span class='kw'>def</span> <span class='id identifier rubyid_event_queue_name'>event_queue_name</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
202
202
|
<span class='lbracket'>[</span><span class='id identifier rubyid_queue_prefix'>queue_prefix</span><span class='comma'>,</span> <span class='id identifier rubyid_base_class'>base_class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
@@ -233,12 +233,12 @@ class</p>
|
|
233
233
|
<pre class="lines">
|
234
234
|
|
235
235
|
|
236
|
-
|
237
|
-
|
238
|
-
|
236
|
+
121
|
237
|
+
122
|
238
|
+
123</pre>
|
239
239
|
</td>
|
240
240
|
<td>
|
241
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line
|
241
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 121</span>
|
242
242
|
|
243
243
|
<span class='kw'>def</span> <span class='id identifier rubyid_find_active_observers'>find_active_observers</span>
|
244
244
|
<span class='lbracket'>[</span><span class='rbracket'>]</span>
|
@@ -263,12 +263,12 @@ class</p>
|
|
263
263
|
<pre class="lines">
|
264
264
|
|
265
265
|
|
266
|
-
|
267
|
-
|
268
|
-
|
266
|
+
125
|
267
|
+
126
|
268
|
+
127</pre>
|
269
269
|
</td>
|
270
270
|
<td>
|
271
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line
|
271
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 125</span>
|
272
272
|
|
273
273
|
<span class='kw'>def</span> <span class='id identifier rubyid_queue_prefix'>queue_prefix</span>
|
274
274
|
<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>
|
@@ -283,9 +283,9 @@ class</p>
|
|
283
283
|
</div>
|
284
284
|
|
285
285
|
<div id="footer">
|
286
|
-
Generated on
|
286
|
+
Generated on Wed Jan 13 16:27:29 2016 by
|
287
287
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
288
|
-
0.8.7.6 (ruby-2.2.
|
288
|
+
0.8.7.6 (ruby-2.2.3).
|
289
289
|
</div>
|
290
290
|
|
291
291
|
</body>
|
@@ -103,18 +103,6 @@
|
|
103
103
|
|
104
104
|
</p>
|
105
105
|
|
106
|
-
<h2>Constant Summary</h2>
|
107
|
-
|
108
|
-
<dl class="constants">
|
109
|
-
|
110
|
-
<dt id="observed_models-classvariable" class="">@@observed_models =
|
111
|
-
|
112
|
-
</dt>
|
113
|
-
<dd><pre class="code"><span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span></pre></dd>
|
114
|
-
|
115
|
-
</dl>
|
116
|
-
|
117
|
-
|
118
106
|
|
119
107
|
|
120
108
|
|
@@ -132,6 +120,100 @@
|
|
132
120
|
<li class="public ">
|
133
121
|
<span class="summary_signature">
|
134
122
|
|
123
|
+
<a href="#activate_observer-instance_method" title="#activate_observer (instance method)">- (Object) <strong>activate_observer</strong>(client = isimud_client) </a>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
</span>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<span class="summary_desc"><div class='inline'>
|
138
|
+
<p>Activate the queues for an observer.</p>
|
139
|
+
</div></span>
|
140
|
+
|
141
|
+
</li>
|
142
|
+
|
143
|
+
|
144
|
+
<li class="public ">
|
145
|
+
<span class="summary_signature">
|
146
|
+
|
147
|
+
<a href="#deactivate_observer-instance_method" title="#deactivate_observer (instance method)">- (Object) <strong>deactivate_observer</strong>(client = isimud_client) </a>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
</span>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="summary_desc"><div class='inline'>
|
162
|
+
<p>Deactivate the queues for an observer.</p>
|
163
|
+
</div></span>
|
164
|
+
|
165
|
+
</li>
|
166
|
+
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="#enable_listener%3F-instance_method" title="#enable_listener? (instance method)">- (Boolean) <strong>enable_listener?</strong> </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
<span class="summary_desc"><div class='inline'>
|
186
|
+
<p>Returns true if this instance is enabled for listening to events.</p>
|
187
|
+
</div></span>
|
188
|
+
|
189
|
+
</li>
|
190
|
+
|
191
|
+
|
192
|
+
<li class="public ">
|
193
|
+
<span class="summary_signature">
|
194
|
+
|
195
|
+
<a href="#event_queue_name-instance_method" title="#event_queue_name (instance method)">- (Object) <strong>event_queue_name</strong> </a>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
</span>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
210
|
+
|
211
|
+
</li>
|
212
|
+
|
213
|
+
|
214
|
+
<li class="public ">
|
215
|
+
<span class="summary_signature">
|
216
|
+
|
135
217
|
<a href="#handle_event-instance_method" title="#handle_event (instance method)">- (Object) <strong>handle_event</strong>(event) </a>
|
136
218
|
|
137
219
|
|
@@ -156,7 +238,29 @@
|
|
156
238
|
<li class="public ">
|
157
239
|
<span class="summary_signature">
|
158
240
|
|
159
|
-
<a href="#
|
241
|
+
<a href="#isimud_client-instance_method" title="#isimud_client (instance method)">- (Object) <strong>isimud_client</strong> </a>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
</span>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
256
|
+
|
257
|
+
</li>
|
258
|
+
|
259
|
+
|
260
|
+
<li class="public ">
|
261
|
+
<span class="summary_signature">
|
262
|
+
|
263
|
+
<a href="#observe_events-instance_method" title="#observe_events (instance method)">- (Object) <strong>observe_events</strong>(client) </a>
|
160
264
|
|
161
265
|
|
162
266
|
|
@@ -174,6 +278,30 @@
|
|
174
278
|
<p>Create or attach to a queue on the specified exchange.</p>
|
175
279
|
</div></span>
|
176
280
|
|
281
|
+
</li>
|
282
|
+
|
283
|
+
|
284
|
+
<li class="public ">
|
285
|
+
<span class="summary_signature">
|
286
|
+
|
287
|
+
<a href="#observed_exchange-instance_method" title="#observed_exchange (instance method)">- (Object) <strong>observed_exchange</strong> </a>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
</span>
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
<span class="summary_desc"><div class='inline'>
|
302
|
+
<p>Exchange used for listening to events.</p>
|
303
|
+
</div></span>
|
304
|
+
|
177
305
|
</li>
|
178
306
|
|
179
307
|
|
@@ -223,7 +351,185 @@
|
|
223
351
|
|
224
352
|
|
225
353
|
<div class="method_details first">
|
226
|
-
<h3 class="signature first" id="
|
354
|
+
<h3 class="signature first" id="activate_observer-instance_method">
|
355
|
+
|
356
|
+
- (<tt>Object</tt>) <strong>activate_observer</strong>(client = isimud_client)
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
</h3><div class="docstring">
|
363
|
+
<div class="discussion">
|
364
|
+
|
365
|
+
<p>Activate the queues for an observer. This will create the observer queue
|
366
|
+
and send an update message on the instance, which will trigger
|
367
|
+
EventListener instances to set up consumers. This is useful for situations
|
368
|
+
when an observer is to be made active without an update.</p>
|
369
|
+
|
370
|
+
|
371
|
+
</div>
|
372
|
+
</div>
|
373
|
+
<div class="tags">
|
374
|
+
|
375
|
+
|
376
|
+
</div><table class="source_code">
|
377
|
+
<tr>
|
378
|
+
<td>
|
379
|
+
<pre class="lines">
|
380
|
+
|
381
|
+
|
382
|
+
76
|
383
|
+
77
|
384
|
+
78
|
385
|
+
79</pre>
|
386
|
+
</td>
|
387
|
+
<td>
|
388
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 76</span>
|
389
|
+
|
390
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_activate_observer'>activate_observer</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='id identifier rubyid_isimud_client'>isimud_client</span><span class='rparen'>)</span>
|
391
|
+
<span class='id identifier rubyid_create_queue'>create_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
|
392
|
+
<span class='id identifier rubyid_isimud_send_action_message'>isimud_send_action_message</span><span class='lparen'>(</span><span class='symbol'>:update</span><span class='rparen'>)</span>
|
393
|
+
<span class='kw'>end</span></pre>
|
394
|
+
</td>
|
395
|
+
</tr>
|
396
|
+
</table>
|
397
|
+
</div>
|
398
|
+
|
399
|
+
<div class="method_details ">
|
400
|
+
<h3 class="signature " id="deactivate_observer-instance_method">
|
401
|
+
|
402
|
+
- (<tt>Object</tt>) <strong>deactivate_observer</strong>(client = isimud_client)
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
</h3><div class="docstring">
|
409
|
+
<div class="discussion">
|
410
|
+
|
411
|
+
<p>Deactivate the queues for an observer. This will destroy the observer queue
|
412
|
+
and send an update message on the instance, which will trigger
|
413
|
+
EventListener instances to cancel consumers. Note that enable_listener?
|
414
|
+
should resolve to false in order for the EventListener to cancel
|
415
|
+
corresponding event consumers.</p>
|
416
|
+
|
417
|
+
|
418
|
+
</div>
|
419
|
+
</div>
|
420
|
+
<div class="tags">
|
421
|
+
|
422
|
+
|
423
|
+
</div><table class="source_code">
|
424
|
+
<tr>
|
425
|
+
<td>
|
426
|
+
<pre class="lines">
|
427
|
+
|
428
|
+
|
429
|
+
84
|
430
|
+
85
|
431
|
+
86
|
432
|
+
87</pre>
|
433
|
+
</td>
|
434
|
+
<td>
|
435
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 84</span>
|
436
|
+
|
437
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_deactivate_observer'>deactivate_observer</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='id identifier rubyid_isimud_client'>isimud_client</span><span class='rparen'>)</span>
|
438
|
+
<span class='id identifier rubyid_delete_queue'>delete_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
|
439
|
+
<span class='id identifier rubyid_isimud_send_action_message'>isimud_send_action_message</span><span class='lparen'>(</span><span class='symbol'>:update</span><span class='rparen'>)</span>
|
440
|
+
<span class='kw'>end</span></pre>
|
441
|
+
</td>
|
442
|
+
</tr>
|
443
|
+
</table>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
<div class="method_details ">
|
447
|
+
<h3 class="signature " id="enable_listener?-instance_method">
|
448
|
+
|
449
|
+
- (<tt>Boolean</tt>) <strong>enable_listener?</strong>
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
</h3><div class="docstring">
|
456
|
+
<div class="discussion">
|
457
|
+
|
458
|
+
<p>Returns true if this instance is enabled for listening to events. Override
|
459
|
+
in your subclass.</p>
|
460
|
+
|
461
|
+
|
462
|
+
</div>
|
463
|
+
</div>
|
464
|
+
<div class="tags">
|
465
|
+
|
466
|
+
<p class="tag_title">Returns:</p>
|
467
|
+
<ul class="return">
|
468
|
+
|
469
|
+
<li>
|
470
|
+
|
471
|
+
|
472
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
473
|
+
|
474
|
+
|
475
|
+
|
476
|
+
</li>
|
477
|
+
|
478
|
+
</ul>
|
479
|
+
|
480
|
+
</div><table class="source_code">
|
481
|
+
<tr>
|
482
|
+
<td>
|
483
|
+
<pre class="lines">
|
484
|
+
|
485
|
+
|
486
|
+
44
|
487
|
+
45
|
488
|
+
46</pre>
|
489
|
+
</td>
|
490
|
+
<td>
|
491
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 44</span>
|
492
|
+
|
493
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_enable_listener?'>enable_listener?</span>
|
494
|
+
<span class='kw'>true</span>
|
495
|
+
<span class='kw'>end</span></pre>
|
496
|
+
</td>
|
497
|
+
</tr>
|
498
|
+
</table>
|
499
|
+
</div>
|
500
|
+
|
501
|
+
<div class="method_details ">
|
502
|
+
<h3 class="signature " id="event_queue_name-instance_method">
|
503
|
+
|
504
|
+
- (<tt>Object</tt>) <strong>event_queue_name</strong>
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
</h3><table class="source_code">
|
511
|
+
<tr>
|
512
|
+
<td>
|
513
|
+
<pre class="lines">
|
514
|
+
|
515
|
+
|
516
|
+
65
|
517
|
+
66
|
518
|
+
67</pre>
|
519
|
+
</td>
|
520
|
+
<td>
|
521
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 65</span>
|
522
|
+
|
523
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_event_queue_name'>event_queue_name</span>
|
524
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_event_queue_name'>event_queue_name</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
525
|
+
<span class='kw'>end</span></pre>
|
526
|
+
</td>
|
527
|
+
</tr>
|
528
|
+
</table>
|
529
|
+
</div>
|
530
|
+
|
531
|
+
<div class="method_details ">
|
532
|
+
<h3 class="signature " id="handle_event-instance_method">
|
227
533
|
|
228
534
|
- (<tt>Object</tt>) <strong>handle_event</strong>(event)
|
229
535
|
|
@@ -248,15 +554,45 @@
|
|
248
554
|
<pre class="lines">
|
249
555
|
|
250
556
|
|
251
|
-
|
252
|
-
|
253
|
-
|
557
|
+
34
|
558
|
+
35
|
559
|
+
36</pre>
|
254
560
|
</td>
|
255
561
|
<td>
|
256
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line
|
562
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 34</span>
|
257
563
|
|
258
564
|
<span class='kw'>def</span> <span class='id identifier rubyid_handle_event'>handle_event</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
|
259
|
-
<span class='
|
565
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Isimud::EventObserver#handle_event not implemented for </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_event_queue_name'>event_queue_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
566
|
+
<span class='kw'>end</span></pre>
|
567
|
+
</td>
|
568
|
+
</tr>
|
569
|
+
</table>
|
570
|
+
</div>
|
571
|
+
|
572
|
+
<div class="method_details ">
|
573
|
+
<h3 class="signature " id="isimud_client-instance_method">
|
574
|
+
|
575
|
+
- (<tt>Object</tt>) <strong>isimud_client</strong>
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
</h3><table class="source_code">
|
582
|
+
<tr>
|
583
|
+
<td>
|
584
|
+
<pre class="lines">
|
585
|
+
|
586
|
+
|
587
|
+
69
|
588
|
+
70
|
589
|
+
71</pre>
|
590
|
+
</td>
|
591
|
+
<td>
|
592
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 69</span>
|
593
|
+
|
594
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_isimud_client'>isimud_client</span>
|
595
|
+
<span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span>
|
260
596
|
<span class='kw'>end</span></pre>
|
261
597
|
</td>
|
262
598
|
</tr>
|
@@ -266,7 +602,7 @@
|
|
266
602
|
<div class="method_details ">
|
267
603
|
<h3 class="signature " id="observe_events-instance_method">
|
268
604
|
|
269
|
-
- (<tt>Object</tt>) <strong>observe_events</strong>(client
|
605
|
+
- (<tt>Object</tt>) <strong>observe_events</strong>(client)
|
270
606
|
|
271
607
|
|
272
608
|
|
@@ -277,7 +613,7 @@
|
|
277
613
|
|
278
614
|
<p>Create or attach to a queue on the specified exchange. When an event
|
279
615
|
message that matches the observer's routing keys is received, parse the
|
280
|
-
event and call handle_event on same
|
616
|
+
event and call handle_event on same. Returns the consumer for the observer</p>
|
281
617
|
|
282
618
|
|
283
619
|
</div>
|
@@ -291,18 +627,22 @@ event and call handle_event on same.</p>
|
|
291
627
|
<pre class="lines">
|
292
628
|
|
293
629
|
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
630
|
+
56
|
631
|
+
57
|
632
|
+
58
|
633
|
+
59
|
634
|
+
60
|
635
|
+
61
|
636
|
+
62
|
637
|
+
63</pre>
|
300
638
|
</td>
|
301
639
|
<td>
|
302
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line
|
640
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 56</span>
|
303
641
|
|
304
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_observe_events'>observe_events</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='
|
305
|
-
<span class='
|
642
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_observe_events'>observe_events</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
|
643
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_enable_listener?'>enable_listener?</span>
|
644
|
+
<span class='id identifier rubyid_queue'>queue</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Isimud</span><span class='op'>::</span><span class='const'>TestClient</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_create_queue'>create_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_find_queue'>find_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_event_queue_name'>event_queue_name</span><span class='rparen'>)</span>
|
645
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_subscribe'>subscribe</span><span class='lparen'>(</span><span class='id identifier rubyid_queue'>queue</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_message'>message</span><span class='op'>|</span>
|
306
646
|
<span class='id identifier rubyid_event'>event</span> <span class='op'>=</span> <span class='const'>Event</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
307
647
|
<span class='id identifier rubyid_handle_event'>handle_event</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
|
308
648
|
<span class='kw'>end</span>
|
@@ -310,6 +650,48 @@ event and call handle_event on same.</p>
|
|
310
650
|
</td>
|
311
651
|
</tr>
|
312
652
|
</table>
|
653
|
+
</div>
|
654
|
+
|
655
|
+
<div class="method_details ">
|
656
|
+
<h3 class="signature " id="observed_exchange-instance_method">
|
657
|
+
|
658
|
+
- (<tt>Object</tt>) <strong>observed_exchange</strong>
|
659
|
+
|
660
|
+
|
661
|
+
|
662
|
+
|
663
|
+
|
664
|
+
</h3><div class="docstring">
|
665
|
+
<div class="discussion">
|
666
|
+
|
667
|
+
<p>Exchange used for listening to events. Override in your subclass if you
|
668
|
+
want to specify an alternative exchange.</p>
|
669
|
+
|
670
|
+
|
671
|
+
</div>
|
672
|
+
</div>
|
673
|
+
<div class="tags">
|
674
|
+
|
675
|
+
|
676
|
+
</div><table class="source_code">
|
677
|
+
<tr>
|
678
|
+
<td>
|
679
|
+
<pre class="lines">
|
680
|
+
|
681
|
+
|
682
|
+
49
|
683
|
+
50
|
684
|
+
51</pre>
|
685
|
+
</td>
|
686
|
+
<td>
|
687
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 49</span>
|
688
|
+
|
689
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_observed_exchange'>observed_exchange</span>
|
690
|
+
<span class='kw'>nil</span>
|
691
|
+
<span class='kw'>end</span></pre>
|
692
|
+
</td>
|
693
|
+
</tr>
|
694
|
+
</table>
|
313
695
|
</div>
|
314
696
|
|
315
697
|
<div class="method_details ">
|
@@ -338,12 +720,12 @@ event and call handle_event on same.</p>
|
|
338
720
|
<pre class="lines">
|
339
721
|
|
340
722
|
|
341
|
-
|
342
|
-
|
343
|
-
|
723
|
+
39
|
724
|
+
40
|
725
|
+
41</pre>
|
344
726
|
</td>
|
345
727
|
<td>
|
346
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line
|
728
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event_observer.rb', line 39</span>
|
347
729
|
|
348
730
|
<span class='kw'>def</span> <span class='id identifier rubyid_routing_keys'>routing_keys</span>
|
349
731
|
<span class='lbracket'>[</span><span class='rbracket'>]</span>
|
@@ -358,9 +740,9 @@ event and call handle_event on same.</p>
|
|
358
740
|
</div>
|
359
741
|
|
360
742
|
<div id="footer">
|
361
|
-
Generated on
|
743
|
+
Generated on Wed Jan 13 16:27:29 2016 by
|
362
744
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
363
|
-
0.8.7.6 (ruby-2.2.
|
745
|
+
0.8.7.6 (ruby-2.2.3).
|
364
746
|
</div>
|
365
747
|
|
366
748
|
</body>
|
@@ -183,9 +183,9 @@
|
|
183
183
|
</div>
|
184
184
|
|
185
185
|
<div id="footer">
|
186
|
-
Generated on
|
186
|
+
Generated on Wed Jan 13 16:27:29 2016 by
|
187
187
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
188
|
-
0.8.7.6 (ruby-2.2.
|
188
|
+
0.8.7.6 (ruby-2.2.3).
|
189
189
|
</div>
|
190
190
|
|
191
191
|
</body>
|
@@ -183,9 +183,9 @@
|
|
183
183
|
</div>
|
184
184
|
|
185
185
|
<div id="footer">
|
186
|
-
Generated on
|
186
|
+
Generated on Wed Jan 13 16:27:29 2016 by
|
187
187
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
188
|
-
0.8.7.6 (ruby-2.2.
|
188
|
+
0.8.7.6 (ruby-2.2.3).
|
189
189
|
</div>
|
190
190
|
|
191
191
|
</body>
|
data/doc/Isimud/Generators.html
CHANGED
@@ -108,9 +108,9 @@
|
|
108
108
|
</div>
|
109
109
|
|
110
110
|
<div id="footer">
|
111
|
-
Generated on
|
111
|
+
Generated on Wed Jan 13 16:27:29 2016 by
|
112
112
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
113
|
-
0.8.7.6 (ruby-2.2.
|
113
|
+
0.8.7.6 (ruby-2.2.3).
|
114
114
|
</div>
|
115
115
|
|
116
116
|
</body>
|
data/doc/Isimud/Logging.html
CHANGED
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
|
80
80
|
<dt class="r1">Included in:</dt>
|
81
|
-
<dd class="r1"><span class='object_link'><a href="Client.html" title="Isimud::Client (class)">Client</a></span>, <span class='object_link'><a href="Event.html" title="Isimud::Event (class)">Event</a></span>, <span class='object_link'><a href="EventListener.html" title="Isimud::EventListener (class)">EventListener</a></span>, <span class='object_link'><a href="EventObserver.html" title="Isimud::EventObserver (module)">EventObserver</a></span>, <span class='object_link'><a href="ModelWatcher.html" title="Isimud::ModelWatcher (module)">ModelWatcher</a></span></dd>
|
81
|
+
<dd class="r1"><span class='object_link'><a href="Client.html" title="Isimud::Client (class)">Client</a></span>, <span class='object_link'><a href="Event.html" title="Isimud::Event (class)">Event</a></span>, <span class='object_link'><a href="EventListener.html" title="Isimud::EventListener (class)">EventListener</a></span>, <span class='object_link'><a href="EventObserver.html" title="Isimud::EventObserver (module)">EventObserver</a></span>, <span class='object_link'><a href="ModelWatcher.html" title="Isimud::ModelWatcher (module)">ModelWatcher</a></span>, <span class='object_link'><a href="TestClient/Queue.html" title="Isimud::TestClient::Queue (class)">TestClient::Queue</a></span></dd>
|
82
82
|
|
83
83
|
|
84
84
|
|
@@ -221,9 +221,9 @@
|
|
221
221
|
</div>
|
222
222
|
|
223
223
|
<div id="footer">
|
224
|
-
Generated on
|
224
|
+
Generated on Wed Jan 13 16:27:29 2016 by
|
225
225
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
226
|
-
0.8.7.6 (ruby-2.2.
|
226
|
+
0.8.7.6 (ruby-2.2.3).
|
227
227
|
</div>
|
228
228
|
|
229
229
|
</body>
|