isimud 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.rspec +2 -0
  4. data/.ruby-version +1 -0
  5. data/.yardoc/checksums +15 -0
  6. data/.yardoc/object_types +0 -0
  7. data/.yardoc/objects/root.dat +0 -0
  8. data/.yardoc/proxy_types +0 -0
  9. data/Gemfile +23 -0
  10. data/Gemfile.lock +123 -0
  11. data/README.md +218 -0
  12. data/Rakefile +2 -0
  13. data/config.ru +7 -0
  14. data/config/tddium.yml +11 -0
  15. data/doc/Isimud.html +1696 -0
  16. data/doc/Isimud/BunnyClient.html +1004 -0
  17. data/doc/Isimud/Client.html +812 -0
  18. data/doc/Isimud/Event.html +1500 -0
  19. data/doc/Isimud/EventListener.html +1217 -0
  20. data/doc/Isimud/EventObserver.html +367 -0
  21. data/doc/Isimud/EventObserver/ClassMethods.html +292 -0
  22. data/doc/Isimud/Generators.html +117 -0
  23. data/doc/Isimud/Generators/ConfigGenerator.html +192 -0
  24. data/doc/Isimud/Generators/InitializerGenerator.html +192 -0
  25. data/doc/Isimud/Logging.html +230 -0
  26. data/doc/Isimud/ModelWatcher.html +312 -0
  27. data/doc/Isimud/ModelWatcher/ClassMethods.html +511 -0
  28. data/doc/Isimud/Railtie.html +123 -0
  29. data/doc/Isimud/TestClient.html +1003 -0
  30. data/doc/Isimud/TestClient/Queue.html +556 -0
  31. data/doc/_index.html +290 -0
  32. data/doc/class_list.html +58 -0
  33. data/doc/css/common.css +1 -0
  34. data/doc/css/full_list.css +57 -0
  35. data/doc/css/style.css +339 -0
  36. data/doc/file.README.html +338 -0
  37. data/doc/file_list.html +60 -0
  38. data/doc/frames.html +26 -0
  39. data/doc/index.html +338 -0
  40. data/doc/js/app.js +219 -0
  41. data/doc/js/full_list.js +181 -0
  42. data/doc/js/jquery.js +4 -0
  43. data/doc/method_list.html +711 -0
  44. data/doc/top-level-namespace.html +112 -0
  45. data/isimud.gemspec +25 -0
  46. data/lib/isimud.rb +91 -0
  47. data/lib/isimud/bunny_client.rb +95 -0
  48. data/lib/isimud/client.rb +48 -0
  49. data/lib/isimud/event.rb +112 -0
  50. data/lib/isimud/event_listener.rb +200 -0
  51. data/lib/isimud/event_observer.rb +81 -0
  52. data/lib/isimud/logging.rb +11 -0
  53. data/lib/isimud/model_watcher.rb +144 -0
  54. data/lib/isimud/railtie.rb +9 -0
  55. data/lib/isimud/tasks.rb +20 -0
  56. data/lib/isimud/test_client.rb +89 -0
  57. data/lib/isimud/version.rb +3 -0
  58. data/lib/rails/generators/isimud/config_generator.rb +12 -0
  59. data/lib/rails/generators/isimud/initializer_generator.rb +12 -0
  60. data/lib/rails/generators/isimud/templates/initializer.rb +17 -0
  61. data/lib/rails/generators/isimud/templates/isimud.yml +20 -0
  62. data/spec/internal/app/models/admin.rb +2 -0
  63. data/spec/internal/app/models/company.rb +34 -0
  64. data/spec/internal/app/models/user.rb +27 -0
  65. data/spec/internal/config/database.yml +3 -0
  66. data/spec/internal/config/routes.rb +3 -0
  67. data/spec/internal/db/schema.rb +22 -0
  68. data/spec/internal/log/.gitignore +1 -0
  69. data/spec/internal/public/favicon.ico +0 -0
  70. data/spec/isimud/bunny_client_spec.rb +125 -0
  71. data/spec/isimud/event_listener_spec.rb +86 -0
  72. data/spec/isimud/event_observer_spec.rb +32 -0
  73. data/spec/isimud/event_spec.rb +74 -0
  74. data/spec/isimud/model_watcher_spec.rb +189 -0
  75. data/spec/isimud/test_client_spec.rb +28 -0
  76. data/spec/isimud_spec.rb +49 -0
  77. data/spec/spec_helper.rb +55 -0
  78. metadata +195 -0
@@ -0,0 +1,1004 @@
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::BunnyClient
8
+
9
+ &mdash; 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/BunnyClient.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 (B)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Isimud.html" title="Isimud (module)">Isimud</a></span></span>
36
+ &raquo;
37
+ <span class="title">BunnyClient</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::BunnyClient
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"><span class='object_link'><a href="Client.html" title="Isimud::Client (class)">Client</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next"><span class='object_link'><a href="Client.html" title="Isimud::Client (class)">Client</a></span></li>
82
+
83
+ <li class="next">Isimud::BunnyClient</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/isimud/bunny_client.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+
105
+ <h2>Constant Summary</h2>
106
+
107
+ <dl class="constants">
108
+
109
+ <dt id="DEFAULT_URL-constant" class="">DEFAULT_URL =
110
+
111
+ </dt>
112
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>amqp://guest:guest@localhost</span><span class='tstring_end'>&#39;</span></span></pre></dd>
113
+
114
+ <dt id="CHANNEL_KEY-constant" class="">CHANNEL_KEY =
115
+
116
+ </dt>
117
+ <dd><pre class="code"><span class='id identifier rubyid_isimud'>isimud</span><span class='period'>.</span><span class='id identifier rubyid_bunny_client'>bunny_client</span><span class='period'>.</span><span class='id identifier rubyid_channel'>channel</span></pre></dd>
118
+
119
+ </dl>
120
+
121
+
122
+
123
+
124
+
125
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
126
+ <ul class="summary">
127
+
128
+ <li class="public ">
129
+ <span class="summary_signature">
130
+
131
+ <a href="#url-instance_method" title="#url (instance method)">- (Object) <strong>url</strong> </a>
132
+
133
+
134
+
135
+ </span>
136
+
137
+
138
+
139
+
140
+ <span class="note title readonly">readonly</span>
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <span class="summary_desc"><div class='inline'>
151
+ <p>Returns the value of attribute url.</p>
152
+ </div></span>
153
+
154
+ </li>
155
+
156
+
157
+ </ul>
158
+
159
+
160
+
161
+
162
+
163
+ <h2>
164
+ Instance Method Summary
165
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
166
+ </h2>
167
+
168
+ <ul class="summary">
169
+
170
+ <li class="public ">
171
+ <span class="summary_signature">
172
+
173
+ <a href="#bind-instance_method" title="#bind (instance method)">- (Object) <strong>bind</strong>(queue_name, exchange_name, *routing_keys, &amp;block) </a>
174
+
175
+
176
+
177
+ </span>
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ <span class="summary_desc"><div class='inline'></div></span>
188
+
189
+ </li>
190
+
191
+
192
+ <li class="public ">
193
+ <span class="summary_signature">
194
+
195
+ <a href="#channel-instance_method" title="#channel (instance method)">- (Object) <strong>channel</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
+
217
+ <a href="#close-instance_method" title="#close (instance method)">- (Object) <strong>close</strong> </a>
218
+
219
+
220
+
221
+ </span>
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+ <span class="summary_desc"><div class='inline'></div></span>
232
+
233
+ </li>
234
+
235
+
236
+ <li class="public ">
237
+ <span class="summary_signature">
238
+
239
+ <a href="#connected%3F-instance_method" title="#connected? (instance method)">- (Boolean) <strong>connected?</strong> </a>
240
+
241
+
242
+
243
+ </span>
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+ <span class="summary_desc"><div class='inline'></div></span>
254
+
255
+ </li>
256
+
257
+
258
+ <li class="public ">
259
+ <span class="summary_signature">
260
+
261
+ <a href="#connection-instance_method" title="#connection (instance method)">- (Object) <strong>connection</strong> </a>
262
+
263
+
264
+
265
+ (also: #connect)
266
+
267
+ </span>
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+ <span class="summary_desc"><div class='inline'></div></span>
278
+
279
+ </li>
280
+
281
+
282
+ <li class="public ">
283
+ <span class="summary_signature">
284
+
285
+ <a href="#create_queue-instance_method" title="#create_queue (instance method)">- (Object) <strong>create_queue</strong>(queue_name, exchange_name, options = {}, &amp;block) </a>
286
+
287
+
288
+
289
+ </span>
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+ <span class="summary_desc"><div class='inline'></div></span>
300
+
301
+ </li>
302
+
303
+
304
+ <li class="public ">
305
+ <span class="summary_signature">
306
+
307
+ <a href="#delete_queue-instance_method" title="#delete_queue (instance method)">- (Object) <strong>delete_queue</strong>(queue_name) </a>
308
+
309
+
310
+
311
+ </span>
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+ <span class="summary_desc"><div class='inline'></div></span>
322
+
323
+ </li>
324
+
325
+
326
+ <li class="public ">
327
+ <span class="summary_signature">
328
+
329
+ <a href="#exception_handler-instance_method" title="#exception_handler (instance method)">- (Object) <strong>exception_handler</strong>(&amp;block) </a>
330
+
331
+
332
+
333
+ </span>
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+ <span class="summary_desc"><div class='inline'></div></span>
344
+
345
+ </li>
346
+
347
+
348
+ <li class="public ">
349
+ <span class="summary_signature">
350
+
351
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (BunnyClient) <strong>initialize</strong>(_url = nil, _bunny_options = {}) </a>
352
+
353
+
354
+
355
+ </span>
356
+
357
+
358
+ <span class="note title constructor">constructor</span>
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+ <span class="summary_desc"><div class='inline'>
368
+ <p>A new instance of BunnyClient.</p>
369
+ </div></span>
370
+
371
+ </li>
372
+
373
+
374
+ <li class="public ">
375
+ <span class="summary_signature">
376
+
377
+ <a href="#publish-instance_method" title="#publish (instance method)">- (Object) <strong>publish</strong>(exchange, routing_key, payload) </a>
378
+
379
+
380
+
381
+ </span>
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+ <span class="summary_desc"><div class='inline'></div></span>
392
+
393
+ </li>
394
+
395
+
396
+ <li class="public ">
397
+ <span class="summary_signature">
398
+
399
+ <a href="#reconnect-instance_method" title="#reconnect (instance method)">- (Object) <strong>reconnect</strong> </a>
400
+
401
+
402
+
403
+ </span>
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+ <span class="summary_desc"><div class='inline'></div></span>
414
+
415
+ </li>
416
+
417
+
418
+ <li class="public ">
419
+ <span class="summary_signature">
420
+
421
+ <a href="#reset-instance_method" title="#reset (instance method)">- (Object) <strong>reset</strong> </a>
422
+
423
+
424
+
425
+ </span>
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+ <span class="summary_desc"><div class='inline'></div></span>
436
+
437
+ </li>
438
+
439
+
440
+ </ul>
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Logging.html" title="Isimud::Logging (module)">Logging</a></span></h3>
459
+ <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>
460
+ <div id="constructor_details" class="method_details_list">
461
+ <h2>Constructor Details</h2>
462
+
463
+ <div class="method_details first">
464
+ <h3 class="signature first" id="initialize-instance_method">
465
+
466
+ - (<tt><span class='object_link'><a href="" title="Isimud::BunnyClient (class)">BunnyClient</a></span></tt>) <strong>initialize</strong>(_url = nil, _bunny_options = {})
467
+
468
+
469
+
470
+
471
+
472
+ </h3><div class="docstring">
473
+ <div class="discussion">
474
+
475
+ <p>Returns a new instance of BunnyClient</p>
476
+
477
+
478
+ </div>
479
+ </div>
480
+ <div class="tags">
481
+
482
+
483
+ </div><table class="source_code">
484
+ <tr>
485
+ <td>
486
+ <pre class="lines">
487
+
488
+
489
+ 10
490
+ 11
491
+ 12
492
+ 13
493
+ 14</pre>
494
+ </td>
495
+ <td>
496
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 10</span>
497
+
498
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid__url'>_url</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid__bunny_options'>_bunny_options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
499
+ <span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Isimud::BunnyClient.initialize: options = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid__bunny_options'>_bunny_options</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
500
+ <span class='ivar'>@url</span> <span class='op'>=</span> <span class='id identifier rubyid__url'>_url</span> <span class='op'>||</span> <span class='const'>DEFAULT_URL</span>
501
+ <span class='ivar'>@bunny_options</span> <span class='op'>=</span> <span class='id identifier rubyid__bunny_options'>_bunny_options</span>
502
+ <span class='kw'>end</span></pre>
503
+ </td>
504
+ </tr>
505
+ </table>
506
+ </div>
507
+
508
+ </div>
509
+
510
+ <div id="instance_attr_details" class="attr_details">
511
+ <h2>Instance Attribute Details</h2>
512
+
513
+
514
+ <span id=""></span>
515
+ <div class="method_details first">
516
+ <h3 class="signature first" id="url-instance_method">
517
+
518
+ - (<tt>Object</tt>) <strong>url</strong> <span class="extras">(readonly)</span>
519
+
520
+
521
+
522
+
523
+
524
+ </h3><div class="docstring">
525
+ <div class="discussion">
526
+
527
+ <p>Returns the value of attribute url</p>
528
+
529
+
530
+ </div>
531
+ </div>
532
+ <div class="tags">
533
+
534
+
535
+ </div><table class="source_code">
536
+ <tr>
537
+ <td>
538
+ <pre class="lines">
539
+
540
+
541
+ 8
542
+ 9
543
+ 10</pre>
544
+ </td>
545
+ <td>
546
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 8</span>
547
+
548
+ <span class='kw'>def</span> <span class='id identifier rubyid_url'>url</span>
549
+ <span class='ivar'>@url</span>
550
+ <span class='kw'>end</span></pre>
551
+ </td>
552
+ </tr>
553
+ </table>
554
+ </div>
555
+
556
+ </div>
557
+
558
+
559
+ <div id="instance_method_details" class="method_details_list">
560
+ <h2>Instance Method Details</h2>
561
+
562
+
563
+ <div class="method_details first">
564
+ <h3 class="signature first" id="bind-instance_method">
565
+
566
+ - (<tt>Object</tt>) <strong>bind</strong>(queue_name, exchange_name, *routing_keys, &amp;block)
567
+
568
+
569
+
570
+
571
+
572
+ </h3><table class="source_code">
573
+ <tr>
574
+ <td>
575
+ <pre class="lines">
576
+
577
+
578
+ 16
579
+ 17
580
+ 18
581
+ 19
582
+ 20
583
+ 21</pre>
584
+ </td>
585
+ <td>
586
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 16</span>
587
+
588
+ <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_routing_keys'>routing_keys</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
589
+ <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>
590
+ <span class='label'>queue_options:</span> <span class='lbrace'>{</span><span class='label'>durable:</span> <span class='kw'>true</span><span class='rbrace'>}</span><span class='comma'>,</span>
591
+ <span class='label'>routing_keys:</span> <span class='id identifier rubyid_routing_keys'>routing_keys</span><span class='comma'>,</span>
592
+ <span class='label'>subscribe_options:</span> <span class='lbrace'>{</span><span class='label'>manual_ack:</span> <span class='kw'>true</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
593
+ <span class='kw'>end</span></pre>
594
+ </td>
595
+ </tr>
596
+ </table>
597
+ </div>
598
+
599
+ <div class="method_details ">
600
+ <h3 class="signature " id="channel-instance_method">
601
+
602
+ - (<tt>Object</tt>) <strong>channel</strong>
603
+
604
+
605
+
606
+
607
+
608
+ </h3><table class="source_code">
609
+ <tr>
610
+ <td>
611
+ <pre class="lines">
612
+
613
+
614
+ 61
615
+ 62
616
+ 63
617
+ 64
618
+ 65
619
+ 66
620
+ 67
621
+ 68
622
+ 69
623
+ 70</pre>
624
+ </td>
625
+ <td>
626
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 61</span>
627
+
628
+ <span class='kw'>def</span> <span class='id identifier rubyid_channel'>channel</span>
629
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_channel'>channel</span> <span class='op'>=</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='const'>CHANNEL_KEY</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_try'>try</span><span class='lparen'>(</span><span class='symbol'>:open?</span><span class='rparen'>)</span>
630
+ <span class='id identifier rubyid_channel'>channel</span>
631
+ <span class='kw'>else</span>
632
+ <span class='id identifier rubyid_new_channel'>new_channel</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_channel'>channel</span>
633
+ <span class='id identifier rubyid_new_channel'>new_channel</span><span class='period'>.</span><span class='id identifier rubyid_confirm_select'>confirm_select</span>
634
+ <span class='id identifier rubyid_new_channel'>new_channel</span><span class='period'>.</span><span class='id identifier rubyid_prefetch'>prefetch</span><span class='lparen'>(</span><span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_prefetch_count'>prefetch_count</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_prefetch_count'>prefetch_count</span>
635
+ <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='const'>CHANNEL_KEY</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_channel'>new_channel</span>
636
+ <span class='kw'>end</span>
637
+ <span class='kw'>end</span></pre>
638
+ </td>
639
+ </tr>
640
+ </table>
641
+ </div>
642
+
643
+ <div class="method_details ">
644
+ <h3 class="signature " id="close-instance_method">
645
+
646
+ - (<tt>Object</tt>) <strong>close</strong>
647
+
648
+
649
+
650
+
651
+
652
+ </h3><table class="source_code">
653
+ <tr>
654
+ <td>
655
+ <pre class="lines">
656
+
657
+
658
+ 86
659
+ 87
660
+ 88
661
+ 89
662
+ 90</pre>
663
+ </td>
664
+ <td>
665
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 86</span>
666
+
667
+ <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
668
+ <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
669
+ <span class='kw'>ensure</span>
670
+ <span class='ivar'>@connection</span> <span class='op'>=</span> <span class='kw'>nil</span>
671
+ <span class='kw'>end</span></pre>
672
+ </td>
673
+ </tr>
674
+ </table>
675
+ </div>
676
+
677
+ <div class="method_details ">
678
+ <h3 class="signature " id="connected?-instance_method">
679
+
680
+ - (<tt>Boolean</tt>) <strong>connected?</strong>
681
+
682
+
683
+
684
+
685
+
686
+ </h3><div class="docstring">
687
+ <div class="discussion">
688
+
689
+
690
+ </div>
691
+ </div>
692
+ <div class="tags">
693
+
694
+ <p class="tag_title">Returns:</p>
695
+ <ul class="return">
696
+
697
+ <li>
698
+
699
+
700
+ <span class='type'>(<tt>Boolean</tt>)</span>
701
+
702
+
703
+
704
+ </li>
705
+
706
+ </ul>
707
+
708
+ </div><table class="source_code">
709
+ <tr>
710
+ <td>
711
+ <pre class="lines">
712
+
713
+
714
+ 82
715
+ 83
716
+ 84</pre>
717
+ </td>
718
+ <td>
719
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 82</span>
720
+
721
+ <span class='kw'>def</span> <span class='id identifier rubyid_connected?'>connected?</span>
722
+ <span class='ivar'>@connection</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_open?'>open?</span>
723
+ <span class='kw'>end</span></pre>
724
+ </td>
725
+ </tr>
726
+ </table>
727
+ </div>
728
+
729
+ <div class="method_details ">
730
+ <h3 class="signature " id="connection-instance_method">
731
+
732
+ - (<tt>Object</tt>) <strong>connection</strong>
733
+
734
+
735
+
736
+ <span class="aliases">Also known as:
737
+ <span class="names"><span id='connect-instance_method'>connect</span></span>
738
+ </span>
739
+
740
+
741
+
742
+ </h3><table class="source_code">
743
+ <tr>
744
+ <td>
745
+ <pre class="lines">
746
+
747
+
748
+ 53
749
+ 54
750
+ 55</pre>
751
+ </td>
752
+ <td>
753
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 53</span>
754
+
755
+ <span class='kw'>def</span> <span class='id identifier rubyid_connection'>connection</span>
756
+ <span class='ivar'>@connection</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>Bunny</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='ivar'>@bunny_options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:start</span><span class='rparen'>)</span>
757
+ <span class='kw'>end</span></pre>
758
+ </td>
759
+ </tr>
760
+ </table>
761
+ </div>
762
+
763
+ <div class="method_details ">
764
+ <h3 class="signature " id="create_queue-instance_method">
765
+
766
+ - (<tt>Object</tt>) <strong>create_queue</strong>(queue_name, exchange_name, options = {}, &amp;block)
767
+
768
+
769
+
770
+
771
+
772
+ </h3><table class="source_code">
773
+ <tr>
774
+ <td>
775
+ <pre class="lines">
776
+
777
+
778
+ 23
779
+ 24
780
+ 25
781
+ 26
782
+ 27
783
+ 28
784
+ 29
785
+ 30
786
+ 31
787
+ 32
788
+ 33
789
+ 34
790
+ 35
791
+ 36
792
+ 37
793
+ 38
794
+ 39
795
+ 40
796
+ 41
797
+ 42
798
+ 43
799
+ 44
800
+ 45
801
+ 46
802
+ 47</pre>
803
+ </td>
804
+ <td>
805
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 23</span>
806
+
807
+ <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='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
808
+ <span class='id identifier rubyid_queue_options'>queue_options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:queue_options</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
809
+ <span class='id identifier rubyid_routing_keys'>routing_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>
810
+ <span class='id identifier rubyid_subscribe_options'>subscribe_options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:subscribe_options</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
811
+ <span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Isimud: create_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'>: queue_options=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_queue_options'>queue_options</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> routing_keys=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_routing_keys'>routing_keys</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>,</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> subscribe_options=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_subscribe_options'>subscribe_options</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
812
+ <span class='id identifier rubyid_current_channel'>current_channel</span> <span class='op'>=</span> <span class='id identifier rubyid_channel'>channel</span>
813
+ <span class='id identifier rubyid_queue'>queue</span> <span class='op'>=</span> <span class='id identifier rubyid_current_channel'>current_channel</span><span class='period'>.</span><span class='id identifier rubyid_queue'>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_queue_options'>queue_options</span><span class='rparen'>)</span>
814
+ <span class='id identifier rubyid_routing_keys'>routing_keys</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <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_key'>key</span><span class='comma'>,</span> <span class='label'>nowait:</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
815
+ <span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_subscribe'>subscribe</span><span class='lparen'>(</span><span class='id identifier rubyid_subscribe_options'>subscribe_options</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_delivery_info'>delivery_info</span><span class='comma'>,</span> <span class='id identifier rubyid_properties'>properties</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='op'>|</span>
816
+ <span class='kw'>begin</span>
817
+ <span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Isimud: 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'> received </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_delivery_info'>delivery_info</span><span class='period'>.</span><span class='id identifier rubyid_delivery_tag'>delivery_tag</span><span class='embexpr_end'>}</span><span class='tstring_content'> routing_key: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_delivery_info'>delivery_info</span><span class='period'>.</span><span class='id identifier rubyid_routing_key'>routing_key</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
818
+ <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>isimud_queue_name</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_queue_name'>queue_name</span>
819
+ <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>isimud_delivery_info</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_delivery_info'>delivery_info</span>
820
+ <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>isimud_properties</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_properties'>properties</span>
821
+ <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
822
+ <span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Isimud: 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'> finished with </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_delivery_info'>delivery_info</span><span class='period'>.</span><span class='id identifier rubyid_delivery_tag'>delivery_tag</span><span class='embexpr_end'>}</span><span class='tstring_content'>, acknowledging</span><span class='tstring_end'>&quot;</span></span>
823
+ <span class='id identifier rubyid_current_channel'>current_channel</span><span class='period'>.</span><span class='id identifier rubyid_ack'>ack</span><span class='lparen'>(</span><span class='id identifier rubyid_delivery_info'>delivery_info</span><span class='period'>.</span><span class='id identifier rubyid_delivery_tag'>delivery_tag</span><span class='rparen'>)</span>
824
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
825
+ <span class='id identifier rubyid_log'>log</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Isimud: 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'> error processing </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_delivery_info'>delivery_info</span><span class='period'>.</span><span class='id identifier rubyid_delivery_tag'>delivery_tag</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='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:warn</span><span class='rparen'>)</span>
826
+ <span class='id identifier rubyid_current_channel'>current_channel</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span><span class='id identifier rubyid_delivery_info'>delivery_info</span><span class='period'>.</span><span class='id identifier rubyid_delivery_tag'>delivery_tag</span><span class='comma'>,</span> <span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_retry_failures'>retry_failures</span><span class='rparen'>)</span>
827
+ <span class='id identifier rubyid_raise'>raise</span>
828
+ <span class='kw'>end</span>
829
+ <span class='kw'>end</span>
830
+ <span class='id identifier rubyid_queue'>queue</span>
831
+ <span class='kw'>end</span></pre>
832
+ </td>
833
+ </tr>
834
+ </table>
835
+ </div>
836
+
837
+ <div class="method_details ">
838
+ <h3 class="signature " id="delete_queue-instance_method">
839
+
840
+ - (<tt>Object</tt>) <strong>delete_queue</strong>(queue_name)
841
+
842
+
843
+
844
+
845
+
846
+ </h3><table class="source_code">
847
+ <tr>
848
+ <td>
849
+ <pre class="lines">
850
+
851
+
852
+ 49
853
+ 50
854
+ 51</pre>
855
+ </td>
856
+ <td>
857
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 49</span>
858
+
859
+ <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>
860
+ <span class='id identifier rubyid_channel'>channel</span><span class='period'>.</span><span class='id identifier rubyid_queue'>queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span>
861
+ <span class='kw'>end</span></pre>
862
+ </td>
863
+ </tr>
864
+ </table>
865
+ </div>
866
+
867
+ <div class="method_details ">
868
+ <h3 class="signature " id="exception_handler-instance_method">
869
+
870
+ - (<tt>Object</tt>) <strong>exception_handler</strong>(&amp;block)
871
+
872
+
873
+
874
+
875
+
876
+ </h3><table class="source_code">
877
+ <tr>
878
+ <td>
879
+ <pre class="lines">
880
+
881
+
882
+ 76
883
+ 77
884
+ 78
885
+ 79
886
+ 80</pre>
887
+ </td>
888
+ <td>
889
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 76</span>
890
+
891
+ <span class='kw'>def</span> <span class='id identifier rubyid_exception_handler'>exception_handler</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
892
+ <span class='id identifier rubyid_channel'>channel</span><span class='period'>.</span><span class='id identifier rubyid_on_uncaught_exception'>on_uncaught_exception</span> <span class='kw'>do</span>
893
+ <span class='kw'>yield</span>
894
+ <span class='kw'>end</span>
895
+ <span class='kw'>end</span></pre>
896
+ </td>
897
+ </tr>
898
+ </table>
899
+ </div>
900
+
901
+ <div class="method_details ">
902
+ <h3 class="signature " id="publish-instance_method">
903
+
904
+ - (<tt>Object</tt>) <strong>publish</strong>(exchange, routing_key, payload)
905
+
906
+
907
+
908
+
909
+
910
+ </h3><table class="source_code">
911
+ <tr>
912
+ <td>
913
+ <pre class="lines">
914
+
915
+
916
+ 92
917
+ 93
918
+ 94</pre>
919
+ </td>
920
+ <td>
921
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 92</span>
922
+
923
+ <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>
924
+ <span class='id identifier rubyid_channel'>channel</span><span class='period'>.</span><span class='id identifier rubyid_topic'>topic</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange'>exchange</span><span class='comma'>,</span> <span class='label'>durable:</span> <span class='kw'>true</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_publish'>publish</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='label'>routing_key:</span> <span class='id identifier rubyid_routing_key'>routing_key</span><span class='comma'>,</span> <span class='label'>persistent:</span> <span class='kw'>true</span><span class='rparen'>)</span>
925
+ <span class='kw'>end</span></pre>
926
+ </td>
927
+ </tr>
928
+ </table>
929
+ </div>
930
+
931
+ <div class="method_details ">
932
+ <h3 class="signature " id="reconnect-instance_method">
933
+
934
+ - (<tt>Object</tt>) <strong>reconnect</strong>
935
+
936
+
937
+
938
+
939
+
940
+ </h3><table class="source_code">
941
+ <tr>
942
+ <td>
943
+ <pre class="lines">
944
+
945
+
946
+ 96
947
+ 97
948
+ 98
949
+ 99</pre>
950
+ </td>
951
+ <td>
952
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 96</span>
953
+
954
+ <span class='kw'>def</span> <span class='id identifier rubyid_reconnect'>reconnect</span>
955
+ <span class='id identifier rubyid_close'>close</span>
956
+ <span class='id identifier rubyid_connect'>connect</span>
957
+ <span class='kw'>end</span></pre>
958
+ </td>
959
+ </tr>
960
+ </table>
961
+ </div>
962
+
963
+ <div class="method_details ">
964
+ <h3 class="signature " id="reset-instance_method">
965
+
966
+ - (<tt>Object</tt>) <strong>reset</strong>
967
+
968
+
969
+
970
+
971
+
972
+ </h3><table class="source_code">
973
+ <tr>
974
+ <td>
975
+ <pre class="lines">
976
+
977
+
978
+ 72
979
+ 73
980
+ 74</pre>
981
+ </td>
982
+ <td>
983
+ <pre class="code"><span class="info file"># File 'lib/isimud/bunny_client.rb', line 72</span>
984
+
985
+ <span class='kw'>def</span> <span class='id identifier rubyid_reset'>reset</span>
986
+ <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_close_all_channels'>close_all_channels</span>
987
+ <span class='kw'>end</span></pre>
988
+ </td>
989
+ </tr>
990
+ </table>
991
+ </div>
992
+
993
+ </div>
994
+
995
+ </div>
996
+
997
+ <div id="footer">
998
+ Generated on Fri Apr 3 09:28:09 2015 by
999
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1000
+ 0.8.7.6 (ruby-2.2.1).
1001
+ </div>
1002
+
1003
+ </body>
1004
+ </html>