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
data/doc/Isimud/TestClient.html
CHANGED
@@ -101,7 +101,26 @@
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
103
103
|
|
104
|
-
<h2>
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>Interface for a messaging client that is suitable for testing. No network
|
108
|
+
connections are involved. Note that all message deliveries are handled in a
|
109
|
+
synchronous manner. When a message is published to the client, each
|
110
|
+
declared queue is examined and, if the message's routing key matches
|
111
|
+
any of the patterns bound to the queue, the queue's block is called
|
112
|
+
with the message. Any uncaught exceptions raised within a message
|
113
|
+
processing block will cause any declared exception handlers to be run.
|
114
|
+
However, the message will not be re-placed onto the queue should this
|
115
|
+
occur.</p>
|
116
|
+
|
117
|
+
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
<div class="tags">
|
121
|
+
|
122
|
+
|
123
|
+
</div><h2>Defined Under Namespace</h2>
|
105
124
|
<p class="children">
|
106
125
|
|
107
126
|
|
@@ -118,35 +137,6 @@
|
|
118
137
|
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
119
138
|
<ul class="summary">
|
120
139
|
|
121
|
-
<li class="public ">
|
122
|
-
<span class="summary_signature">
|
123
|
-
|
124
|
-
<a href="#exception_handler-instance_method" title="#exception_handler (instance method)">- (Object) <strong>exception_handler</strong>(&block) </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>Returns the value of attribute exception_handler.</p>
|
145
|
-
</div></span>
|
146
|
-
|
147
|
-
</li>
|
148
|
-
|
149
|
-
|
150
140
|
<li class="public ">
|
151
141
|
<span class="summary_signature">
|
152
142
|
|
@@ -190,7 +180,7 @@
|
|
190
180
|
<li class="public ">
|
191
181
|
<span class="summary_signature">
|
192
182
|
|
193
|
-
<a href="#bind-instance_method" title="#bind (instance method)">- (Object) <strong>bind</strong>(queue_name, exchange_name, *keys, &
|
183
|
+
<a href="#bind-instance_method" title="#bind (instance method)">- (Object) <strong>bind</strong>(queue_name, exchange_name, *keys, &block) </a>
|
194
184
|
|
195
185
|
|
196
186
|
|
@@ -300,7 +290,7 @@
|
|
300
290
|
<li class="public ">
|
301
291
|
<span class="summary_signature">
|
302
292
|
|
303
|
-
<a href="#create_queue-instance_method" title="#create_queue (instance method)">- (Object) <strong>create_queue</strong>(queue_name, exchange_name, options = {}
|
293
|
+
<a href="#create_queue-instance_method" title="#create_queue (instance method)">- (Object) <strong>create_queue</strong>(queue_name, exchange_name, options = {}) </a>
|
304
294
|
|
305
295
|
|
306
296
|
|
@@ -344,7 +334,29 @@
|
|
344
334
|
<li class="public ">
|
345
335
|
<span class="summary_signature">
|
346
336
|
|
347
|
-
<a href="#
|
337
|
+
<a href="#find_queue-instance_method" title="#find_queue (instance method)">- (Object) <strong>find_queue</strong>(queue_name, options = {}) </a>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
</span>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
352
|
+
|
353
|
+
</li>
|
354
|
+
|
355
|
+
|
356
|
+
<li class="public ">
|
357
|
+
<span class="summary_signature">
|
358
|
+
|
359
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (TestClient) <strong>initialize</strong>(connection = nil, options = {}) </a>
|
348
360
|
|
349
361
|
|
350
362
|
|
@@ -370,7 +382,7 @@
|
|
370
382
|
<li class="public ">
|
371
383
|
<span class="summary_signature">
|
372
384
|
|
373
|
-
<a href="#
|
385
|
+
<a href="#publish-instance_method" title="#publish (instance method)">- (Object) <strong>publish</strong>(exchange, routing_key, payload) </a>
|
374
386
|
|
375
387
|
|
376
388
|
|
@@ -392,7 +404,7 @@
|
|
392
404
|
<li class="public ">
|
393
405
|
<span class="summary_signature">
|
394
406
|
|
395
|
-
<a href="#
|
407
|
+
<a href="#reconnect-instance_method" title="#reconnect (instance method)">- (Object) <strong>reconnect</strong> </a>
|
396
408
|
|
397
409
|
|
398
410
|
|
@@ -414,7 +426,7 @@
|
|
414
426
|
<li class="public ">
|
415
427
|
<span class="summary_signature">
|
416
428
|
|
417
|
-
<a href="#
|
429
|
+
<a href="#reset-instance_method" title="#reset (instance method)">- (Object) <strong>reset</strong> </a>
|
418
430
|
|
419
431
|
|
420
432
|
|
@@ -436,7 +448,7 @@
|
|
436
448
|
<li class="public ">
|
437
449
|
<span class="summary_signature">
|
438
450
|
|
439
|
-
<a href="#
|
451
|
+
<a href="#subscribe-instance_method" title="#subscribe (instance method)">- (Object) <strong>subscribe</strong>(queue, options = {}, &block) </a>
|
440
452
|
|
441
453
|
|
442
454
|
|
@@ -467,6 +479,11 @@
|
|
467
479
|
|
468
480
|
|
469
481
|
|
482
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Client.html" title="Isimud::Client (class)">Client</a></span></h3>
|
483
|
+
<p class="inherited"><span class='object_link'><a href="Client.html#on_exception-instance_method" title="Isimud::Client#on_exception (method)">#on_exception</a></span>, <span class='object_link'><a href="Client.html#run_exception_handlers-instance_method" title="Isimud::Client#run_exception_handlers (method)">#run_exception_handlers</a></span></p>
|
484
|
+
|
485
|
+
|
486
|
+
|
470
487
|
|
471
488
|
|
472
489
|
|
@@ -474,14 +491,14 @@
|
|
474
491
|
|
475
492
|
|
476
493
|
<h3 class="inherited">Methods included from <span class='object_link'><a href="Logging.html" title="Isimud::Logging (module)">Logging</a></span></h3>
|
477
|
-
<p class="inherited"><span class='object_link'><a href="Logging.html#log-instance_method" title="Isimud::Logging#log (method)">#log</a></span></p>
|
494
|
+
<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>
|
478
495
|
<div id="constructor_details" class="method_details_list">
|
479
496
|
<h2>Constructor Details</h2>
|
480
497
|
|
481
498
|
<div class="method_details first">
|
482
499
|
<h3 class="signature first" id="initialize-instance_method">
|
483
500
|
|
484
|
-
- (<tt><span class='object_link'><a href="" title="Isimud::TestClient (class)">TestClient</a></span></tt>) <strong>initialize</strong>(connection = nil, options =
|
501
|
+
- (<tt><span class='object_link'><a href="" title="Isimud::TestClient (class)">TestClient</a></span></tt>) <strong>initialize</strong>(connection = nil, options = {})
|
485
502
|
|
486
503
|
|
487
504
|
|
@@ -504,14 +521,14 @@
|
|
504
521
|
<pre class="lines">
|
505
522
|
|
506
523
|
|
507
|
-
|
508
|
-
|
509
|
-
|
524
|
+
63
|
525
|
+
64
|
526
|
+
65</pre>
|
510
527
|
</td>
|
511
528
|
<td>
|
512
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
529
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 63</span>
|
513
530
|
|
514
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_connection'>connection</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='
|
531
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_connection'>connection</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</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>
|
515
532
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_queues'>queues</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
516
533
|
<span class='kw'>end</span></pre>
|
517
534
|
</td>
|
@@ -525,52 +542,9 @@
|
|
525
542
|
<h2>Instance Attribute Details</h2>
|
526
543
|
|
527
544
|
|
528
|
-
<span id=""></span>
|
529
|
-
<div class="method_details first">
|
530
|
-
<h3 class="signature first" id="exception_handler-instance_method">
|
531
|
-
|
532
|
-
- (<tt>Object</tt>) <strong>exception_handler</strong>(&block) <span class="extras">(readonly)</span>
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
</h3><div class="docstring">
|
539
|
-
<div class="discussion">
|
540
|
-
|
541
|
-
<p>Returns the value of attribute exception_handler</p>
|
542
|
-
|
543
|
-
|
544
|
-
</div>
|
545
|
-
</div>
|
546
|
-
<div class="tags">
|
547
|
-
|
548
|
-
|
549
|
-
</div><table class="source_code">
|
550
|
-
<tr>
|
551
|
-
<td>
|
552
|
-
<pre class="lines">
|
553
|
-
|
554
|
-
|
555
|
-
4
|
556
|
-
5
|
557
|
-
6</pre>
|
558
|
-
</td>
|
559
|
-
<td>
|
560
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 4</span>
|
561
|
-
|
562
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_exception_handler'>exception_handler</span>
|
563
|
-
<span class='ivar'>@exception_handler</span>
|
564
|
-
<span class='kw'>end</span></pre>
|
565
|
-
</td>
|
566
|
-
</tr>
|
567
|
-
</table>
|
568
|
-
</div>
|
569
|
-
|
570
|
-
|
571
545
|
<span id="queues=-instance_method"></span>
|
572
|
-
<div class="method_details ">
|
573
|
-
<h3 class="signature " id="queues-instance_method">
|
546
|
+
<div class="method_details first">
|
547
|
+
<h3 class="signature first" id="queues-instance_method">
|
574
548
|
|
575
549
|
- (<tt>Object</tt>) <strong>queues</strong>
|
576
550
|
|
@@ -595,12 +569,12 @@
|
|
595
569
|
<pre class="lines">
|
596
570
|
|
597
571
|
|
598
|
-
|
599
|
-
|
600
|
-
|
572
|
+
10
|
573
|
+
11
|
574
|
+
12</pre>
|
601
575
|
</td>
|
602
576
|
<td>
|
603
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
577
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 10</span>
|
604
578
|
|
605
579
|
<span class='kw'>def</span> <span class='id identifier rubyid_queues'>queues</span>
|
606
580
|
<span class='ivar'>@queues</span>
|
@@ -620,7 +594,7 @@
|
|
620
594
|
<div class="method_details first">
|
621
595
|
<h3 class="signature first" id="bind-instance_method">
|
622
596
|
|
623
|
-
- (<tt>Object</tt>) <strong>bind</strong>(queue_name, exchange_name, *keys, &
|
597
|
+
- (<tt>Object</tt>) <strong>bind</strong>(queue_name, exchange_name, *keys, &block)
|
624
598
|
|
625
599
|
|
626
600
|
|
@@ -632,15 +606,17 @@
|
|
632
606
|
<pre class="lines">
|
633
607
|
|
634
608
|
|
635
|
-
|
636
|
-
|
637
|
-
|
609
|
+
86
|
610
|
+
87
|
611
|
+
88
|
612
|
+
89</pre>
|
638
613
|
</td>
|
639
614
|
<td>
|
640
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
615
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 86</span>
|
641
616
|
|
642
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_bind'>bind</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='comma'>,</span> <span class='id identifier rubyid_exchange_name'>exchange_name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_keys'>keys</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier
|
643
|
-
<span class='id identifier rubyid_create_queue'>create_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='comma'>,</span> <span class='id identifier rubyid_exchange_name'>exchange_name</span><span class='comma'>,</span> <span class='label'>routing_keys:</span> <span class='id identifier rubyid_keys'>keys</span><span class='
|
617
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_bind'>bind</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='comma'>,</span> <span class='id identifier rubyid_exchange_name'>exchange_name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_keys'>keys</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
618
|
+
<span class='id identifier rubyid_queue'>queue</span> <span class='op'>=</span> <span class='id identifier rubyid_create_queue'>create_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='comma'>,</span> <span class='id identifier rubyid_exchange_name'>exchange_name</span><span class='comma'>,</span> <span class='label'>routing_keys:</span> <span class='id identifier rubyid_keys'>keys</span><span class='rparen'>)</span>
|
619
|
+
<span class='id identifier rubyid_subscribe'>subscribe</span><span class='lparen'>(</span><span class='id identifier rubyid_queue'>queue</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
644
620
|
<span class='kw'>end</span></pre>
|
645
621
|
</td>
|
646
622
|
</tr>
|
@@ -662,12 +638,12 @@
|
|
662
638
|
<pre class="lines">
|
663
639
|
|
664
640
|
|
665
|
-
|
666
|
-
|
667
|
-
|
641
|
+
71
|
642
|
+
72
|
643
|
+
73</pre>
|
668
644
|
</td>
|
669
645
|
<td>
|
670
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
646
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 71</span>
|
671
647
|
|
672
648
|
<span class='kw'>def</span> <span class='id identifier rubyid_channel'>channel</span>
|
673
649
|
<span class='kw'>self</span>
|
@@ -692,11 +668,11 @@
|
|
692
668
|
<pre class="lines">
|
693
669
|
|
694
670
|
|
695
|
-
|
696
|
-
|
671
|
+
79
|
672
|
+
80</pre>
|
697
673
|
</td>
|
698
674
|
<td>
|
699
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
675
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 79</span>
|
700
676
|
|
701
677
|
<span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
|
702
678
|
<span class='kw'>end</span></pre>
|
@@ -720,12 +696,12 @@
|
|
720
696
|
<pre class="lines">
|
721
697
|
|
722
698
|
|
723
|
-
|
724
|
-
|
725
|
-
|
699
|
+
67
|
700
|
+
68
|
701
|
+
69</pre>
|
726
702
|
</td>
|
727
703
|
<td>
|
728
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
704
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 67</span>
|
729
705
|
|
730
706
|
<span class='kw'>def</span> <span class='id identifier rubyid_connect'>connect</span>
|
731
707
|
<span class='kw'>self</span>
|
@@ -772,12 +748,12 @@
|
|
772
748
|
<pre class="lines">
|
773
749
|
|
774
750
|
|
775
|
-
|
776
|
-
|
777
|
-
|
751
|
+
75
|
752
|
+
76
|
753
|
+
77</pre>
|
778
754
|
</td>
|
779
755
|
<td>
|
780
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
756
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 75</span>
|
781
757
|
|
782
758
|
<span class='kw'>def</span> <span class='id identifier rubyid_connected?'>connected?</span>
|
783
759
|
<span class='kw'>true</span>
|
@@ -790,7 +766,7 @@
|
|
790
766
|
<div class="method_details ">
|
791
767
|
<h3 class="signature " id="create_queue-instance_method">
|
792
768
|
|
793
|
-
- (<tt>Object</tt>) <strong>create_queue</strong>(queue_name, exchange_name, options = {}
|
769
|
+
- (<tt>Object</tt>) <strong>create_queue</strong>(queue_name, exchange_name, options = {})
|
794
770
|
|
795
771
|
|
796
772
|
|
@@ -802,23 +778,23 @@
|
|
802
778
|
<pre class="lines">
|
803
779
|
|
804
780
|
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
781
|
+
95
|
782
|
+
96
|
783
|
+
97
|
784
|
+
98
|
785
|
+
99
|
786
|
+
100
|
787
|
+
101
|
788
|
+
102
|
789
|
+
103</pre>
|
814
790
|
</td>
|
815
791
|
<td>
|
816
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
792
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 95</span>
|
817
793
|
|
818
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_create_queue'>create_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='comma'>,</span> <span class='id identifier rubyid_exchange_name'>exchange_name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='
|
794
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create_queue'>create_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='comma'>,</span> <span class='id identifier rubyid_exchange_name'>exchange_name</span><span class='comma'>,</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>
|
819
795
|
<span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:routing_keys</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
820
796
|
<span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Isimud::TestClient: Binding queue </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='embexpr_end'>}</span><span class='tstring_content'> for keys </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
821
|
-
<span class='id identifier rubyid_queue'>queue</span> <span class='op'>=</span> <span class='id identifier
|
797
|
+
<span class='id identifier rubyid_queue'>queue</span> <span class='op'>=</span> <span class='id identifier rubyid_find_queue'>find_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='rparen'>)</span>
|
822
798
|
<span class='id identifier rubyid_keys'>keys</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_k'>k</span><span class='op'>|</span>
|
823
799
|
<span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_bind'>bind</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange_name'>exchange_name</span><span class='comma'>,</span> <span class='label'>routing_key:</span> <span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span>
|
824
800
|
<span class='kw'>end</span>
|
@@ -844,12 +820,12 @@
|
|
844
820
|
<pre class="lines">
|
845
821
|
|
846
822
|
|
847
|
-
|
848
|
-
|
849
|
-
|
823
|
+
82
|
824
|
+
83
|
825
|
+
84</pre>
|
850
826
|
</td>
|
851
827
|
<td>
|
852
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
828
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 82</span>
|
853
829
|
|
854
830
|
<span class='kw'>def</span> <span class='id identifier rubyid_delete_queue'>delete_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='rparen'>)</span>
|
855
831
|
<span class='id identifier rubyid_queues'>queues</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='rparen'>)</span>
|
@@ -860,9 +836,9 @@
|
|
860
836
|
</div>
|
861
837
|
|
862
838
|
<div class="method_details ">
|
863
|
-
<h3 class="signature " id="
|
839
|
+
<h3 class="signature " id="find_queue-instance_method">
|
864
840
|
|
865
|
-
- (<tt>Object</tt>) <strong>
|
841
|
+
- (<tt>Object</tt>) <strong>find_queue</strong>(queue_name, options = {})
|
866
842
|
|
867
843
|
|
868
844
|
|
@@ -874,15 +850,15 @@
|
|
874
850
|
<pre class="lines">
|
875
851
|
|
876
852
|
|
853
|
+
91
|
877
854
|
92
|
878
|
-
93
|
879
|
-
94</pre>
|
855
|
+
93</pre>
|
880
856
|
</td>
|
881
857
|
<td>
|
882
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
858
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 91</span>
|
883
859
|
|
884
|
-
<span class='kw'>def</span> <span class='id identifier
|
885
|
-
<span class='const'>
|
860
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_queue'>find_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='comma'>,</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>
|
861
|
+
<span class='id identifier rubyid_queues'>queues</span><span class='lbracket'>[</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='const'>Queue</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='rparen'>)</span>
|
886
862
|
<span class='kw'>end</span></pre>
|
887
863
|
</td>
|
888
864
|
</tr>
|
@@ -904,24 +880,24 @@
|
|
904
880
|
<pre class="lines">
|
905
881
|
|
906
882
|
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
883
|
+
110
|
884
|
+
111
|
885
|
+
112
|
886
|
+
113
|
887
|
+
114
|
888
|
+
115
|
889
|
+
116
|
890
|
+
117</pre>
|
915
891
|
</td>
|
916
892
|
<td>
|
917
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
893
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 110</span>
|
918
894
|
|
919
895
|
<span class='kw'>def</span> <span class='id identifier rubyid_publish'>publish</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange'>exchange</span><span class='comma'>,</span> <span class='id identifier rubyid_routing_key'>routing_key</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
920
|
-
<span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Isimud::TestClient: Delivering message key: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_routing_key'>routing_key</span><span class='embexpr_end'>}</span><span class='tstring_content'> payload: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_payload'>payload</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
921
|
-
<span class='id identifier rubyid_call_queues'>call_queues</span> <span class='op'>=</span> <span class='id identifier rubyid_queues'>queues</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_queue'>queue</span><span class='op'>|</span> <span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_has_matching_key?'>has_matching_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_routing_key'>routing_key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
896
|
+
<span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Isimud::TestClient: Delivering message exchange: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_exchange'>exchange</span><span class='embexpr_end'>}</span><span class='tstring_content'> key: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_routing_key'>routing_key</span><span class='embexpr_end'>}</span><span class='tstring_content'> payload: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_payload'>payload</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
897
|
+
<span class='id identifier rubyid_call_queues'>call_queues</span> <span class='op'>=</span> <span class='id identifier rubyid_queues'>queues</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_queue'>queue</span><span class='op'>|</span> <span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_has_matching_key?'>has_matching_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange'>exchange</span><span class='comma'>,</span> <span class='id identifier rubyid_routing_key'>routing_key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
922
898
|
<span class='id identifier rubyid_call_queues'>call_queues</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_queue'>queue</span><span class='op'>|</span>
|
923
899
|
<span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Isimud::TestClient: Queue </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> matches routing key </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_routing_key'>routing_key</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
924
|
-
<span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier
|
900
|
+
<span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_deliver'>deliver</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
925
901
|
<span class='kw'>end</span>
|
926
902
|
<span class='kw'>end</span></pre>
|
927
903
|
</td>
|
@@ -944,12 +920,12 @@
|
|
944
920
|
<pre class="lines">
|
945
921
|
|
946
922
|
|
947
|
-
|
948
|
-
|
949
|
-
|
923
|
+
123
|
924
|
+
124
|
925
|
+
125</pre>
|
950
926
|
</td>
|
951
927
|
<td>
|
952
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
928
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 123</span>
|
953
929
|
|
954
930
|
<span class='kw'>def</span> <span class='id identifier rubyid_reconnect'>reconnect</span>
|
955
931
|
<span class='kw'>self</span>
|
@@ -974,12 +950,12 @@
|
|
974
950
|
<pre class="lines">
|
975
951
|
|
976
952
|
|
977
|
-
|
978
|
-
|
979
|
-
|
953
|
+
119
|
954
|
+
120
|
955
|
+
121</pre>
|
980
956
|
</td>
|
981
957
|
<td>
|
982
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line
|
958
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 119</span>
|
983
959
|
|
984
960
|
<span class='kw'>def</span> <span class='id identifier rubyid_reset'>reset</span>
|
985
961
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_queues'>queues</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
|
@@ -987,6 +963,38 @@
|
|
987
963
|
</td>
|
988
964
|
</tr>
|
989
965
|
</table>
|
966
|
+
</div>
|
967
|
+
|
968
|
+
<div class="method_details ">
|
969
|
+
<h3 class="signature " id="subscribe-instance_method">
|
970
|
+
|
971
|
+
- (<tt>Object</tt>) <strong>subscribe</strong>(queue, options = {}, &block)
|
972
|
+
|
973
|
+
|
974
|
+
|
975
|
+
|
976
|
+
|
977
|
+
</h3><table class="source_code">
|
978
|
+
<tr>
|
979
|
+
<td>
|
980
|
+
<pre class="lines">
|
981
|
+
|
982
|
+
|
983
|
+
105
|
984
|
+
106
|
985
|
+
107
|
986
|
+
108</pre>
|
987
|
+
</td>
|
988
|
+
<td>
|
989
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 105</span>
|
990
|
+
|
991
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_subscribe'>subscribe</span><span class='lparen'>(</span><span class='id identifier rubyid_queue'>queue</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
992
|
+
<span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_proc'>proc</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
993
|
+
<span class='id identifier rubyid_queue'>queue</span>
|
994
|
+
<span class='kw'>end</span></pre>
|
995
|
+
</td>
|
996
|
+
</tr>
|
997
|
+
</table>
|
990
998
|
</div>
|
991
999
|
|
992
1000
|
</div>
|
@@ -994,9 +1002,9 @@
|
|
994
1002
|
</div>
|
995
1003
|
|
996
1004
|
<div id="footer">
|
997
|
-
Generated on
|
1005
|
+
Generated on Wed Jan 13 16:27:29 2016 by
|
998
1006
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
999
|
-
0.8.7.6 (ruby-2.2.
|
1007
|
+
0.8.7.6 (ruby-2.2.3).
|
1000
1008
|
</div>
|
1001
1009
|
|
1002
1010
|
</body>
|