tango-etl 0.0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/{changelog.md → CHANGELOG.md} +5 -1
  3. data/{readme.md → README.md} +1 -1
  4. data/doc/Multidb/Balancer.html +202 -0
  5. data/doc/Multidb.html +184 -0
  6. data/doc/Tango/AbstractModel.html +608 -0
  7. data/doc/Tango/App.html +1334 -0
  8. data/doc/Tango/DatabaseLocker.html +541 -0
  9. data/doc/Tango/ETL/Dispatcher.html +465 -0
  10. data/doc/Tango/ETL/HandlerInterface.html +639 -0
  11. data/doc/Tango/ETL/OperatorInterface.html +494 -0
  12. data/doc/Tango/ETL.html +117 -0
  13. data/doc/Tango/Kernel.html +432 -0
  14. data/doc/Tango/LinkStack.html +737 -0
  15. data/doc/Tango/Resource/Buffer.html +565 -0
  16. data/doc/Tango/Resource/Cache.html +834 -0
  17. data/doc/Tango/Resource.html +117 -0
  18. data/doc/Tango.html +131 -0
  19. data/doc/_index.html +297 -0
  20. data/doc/class_list.html +54 -0
  21. data/doc/css/common.css +1 -0
  22. data/doc/css/full_list.css +57 -0
  23. data/doc/css/style.css +339 -0
  24. data/doc/file.README.html +80 -0
  25. data/doc/file_list.html +56 -0
  26. data/doc/frames.html +26 -0
  27. data/doc/index.html +80 -0
  28. data/doc/js/app.js +219 -0
  29. data/doc/js/full_list.js +178 -0
  30. data/doc/js/jquery.js +4 -0
  31. data/doc/method_list.html +365 -0
  32. data/doc/top-level-namespace.html +112 -0
  33. data/lib/tango/abstract_model.rb +1 -0
  34. data/lib/tango/app.rb +4 -7
  35. data/lib/tango/database_locker.rb +23 -2
  36. data/lib/tango/etl/handler_interface.rb +12 -6
  37. data/lib/tango/resource/buffer.rb +7 -7
  38. data/lib/tango/resource/cache.rb +18 -13
  39. data/lib/tango/version.rb +1 -1
  40. data/test/support/lib/simple_handler.rb +5 -14
  41. data/test/unit/etl/test_dispatcher.rb +21 -5
  42. metadata +33 -6
  43. data/config/app.yml.sample +0 -6
  44. data/config/database.yml.sample +0 -27
@@ -0,0 +1,565 @@
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: Tango::Resource::Buffer
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
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#!Tango/Resource/Buffer.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="../../Tango.html" title="Tango (module)">Tango</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Resource.html" title="Tango::Resource (module)">Resource</a></span></span>
36
+ &raquo;
37
+ <span class="title">Buffer</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: Tango::Resource::Buffer
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Tango::Resource::Buffer</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/tango/resource/buffer.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Resource buffer</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+ <p class="tag_title">Author:</p>
113
+ <ul class="author">
114
+
115
+ <li>
116
+
117
+
118
+
119
+
120
+
121
+ <div class='inline'>
122
+ <p>Mckomo</p>
123
+ </div>
124
+
125
+ </li>
126
+
127
+ </ul>
128
+
129
+ </div>
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+ <h2>
138
+ Instance Method Summary
139
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
140
+ </h2>
141
+
142
+ <ul class="summary">
143
+
144
+ <li class="public ">
145
+ <span class="summary_signature">
146
+
147
+ <a href="#fill-instance_method" title="#fill (instance method)">- (Object) <strong>fill</strong>(type, resource) </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>Fill buffer with a resource.</p>
163
+ </div></span>
164
+
165
+ </li>
166
+
167
+
168
+ <li class="public ">
169
+ <span class="summary_signature">
170
+
171
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Tango::Resource::Buffer) <strong>initialize</strong>(size = 500) </a>
172
+
173
+
174
+
175
+ </span>
176
+
177
+
178
+ <span class="note title constructor">constructor</span>
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ <span class="summary_desc"><div class='inline'>
188
+ <p>Constructor of the Buffer.</p>
189
+ </div></span>
190
+
191
+ </li>
192
+
193
+
194
+ <li class="public ">
195
+ <span class="summary_signature">
196
+
197
+ <a href="#register-instance_method" title="#register (instance method)">- (Object) <strong>register</strong>(type, &amp;release_callback) </a>
198
+
199
+
200
+
201
+ </span>
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+ <span class="summary_desc"><div class='inline'>
212
+ <p>Register new type of resource to be buffered.</p>
213
+ </div></span>
214
+
215
+ </li>
216
+
217
+
218
+ <li class="public ">
219
+ <span class="summary_signature">
220
+
221
+ <a href="#release_all-instance_method" title="#release_all (instance method)">- (Object) <strong>release_all</strong> </a>
222
+
223
+
224
+
225
+ </span>
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+ <span class="summary_desc"><div class='inline'>
236
+ <p>Release all registered buffers.</p>
237
+ </div></span>
238
+
239
+ </li>
240
+
241
+
242
+ </ul>
243
+
244
+
245
+ <div id="constructor_details" class="method_details_list">
246
+ <h2>Constructor Details</h2>
247
+
248
+ <div class="method_details first">
249
+ <h3 class="signature first" id="initialize-instance_method">
250
+
251
+ - (<tt><span class='object_link'><a href="" title="Tango::Resource::Buffer (class)">Tango::Resource::Buffer</a></span></tt>) <strong>initialize</strong>(size = 500)
252
+
253
+
254
+
255
+
256
+
257
+ </h3><div class="docstring">
258
+ <div class="discussion">
259
+
260
+ <p>Constructor of the Buffer</p>
261
+
262
+
263
+ </div>
264
+ </div>
265
+ <div class="tags">
266
+ <p class="tag_title">Parameters:</p>
267
+ <ul class="param">
268
+
269
+ <li>
270
+
271
+ <span class='name'>size</span>
272
+
273
+
274
+ <span class='type'>(<tt>Integer</tt>)</span>
275
+
276
+
277
+ <em class="default">(defaults to: <tt>500</tt>)</em>
278
+
279
+
280
+ </li>
281
+
282
+ </ul>
283
+
284
+
285
+ </div><table class="source_code">
286
+ <tr>
287
+ <td>
288
+ <pre class="lines">
289
+
290
+
291
+ 13
292
+ 14
293
+ 15
294
+ 16
295
+ 17
296
+ 18
297
+ 19
298
+ 20
299
+ 21
300
+ 22
301
+ 23</pre>
302
+ </td>
303
+ <td>
304
+ <pre class="code"><span class="info file"># File 'lib/tango/resource/buffer.rb', line 13</span>
305
+
306
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span> <span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='int'>500</span> <span class='rparen'>)</span>
307
+
308
+ <span class='comment'># Set max size of the buffer
309
+ </span> <span class='ivar'>@size</span> <span class='op'>=</span> <span class='id identifier rubyid_size'>size</span>
310
+
311
+ <span class='comment'># Buffer storage for resources
312
+ </span> <span class='ivar'>@resources</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
313
+ <span class='comment'># Container of callbacks for each registered resource type
314
+ </span> <span class='ivar'>@callbacks</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
315
+
316
+ <span class='kw'>end</span></pre>
317
+ </td>
318
+ </tr>
319
+ </table>
320
+ </div>
321
+
322
+ </div>
323
+
324
+
325
+ <div id="instance_method_details" class="method_details_list">
326
+ <h2>Instance Method Details</h2>
327
+
328
+
329
+ <div class="method_details first">
330
+ <h3 class="signature first" id="fill-instance_method">
331
+
332
+ - (<tt>Object</tt>) <strong>fill</strong>(type, resource)
333
+
334
+
335
+
336
+
337
+
338
+ </h3><div class="docstring">
339
+ <div class="discussion">
340
+
341
+ <p>Fill buffer with a resource</p>
342
+
343
+
344
+ </div>
345
+ </div>
346
+ <div class="tags">
347
+ <p class="tag_title">Parameters:</p>
348
+ <ul class="param">
349
+
350
+ <li>
351
+
352
+ <span class='name'>type</span>
353
+
354
+
355
+ <span class='type'>(<tt>Symbol</tt>)</span>
356
+
357
+
358
+
359
+ </li>
360
+
361
+ <li>
362
+
363
+ <span class='name'>resource</span>
364
+
365
+
366
+ <span class='type'>(<tt>Object</tt>)</span>
367
+
368
+
369
+
370
+ </li>
371
+
372
+ </ul>
373
+
374
+ <p class="tag_title">Raises:</p>
375
+ <ul class="raise">
376
+
377
+ <li>
378
+
379
+
380
+ <span class='type'>(<tt>ArgumentError</tt>)</span>
381
+
382
+
383
+
384
+ </li>
385
+
386
+ </ul>
387
+
388
+ </div><table class="source_code">
389
+ <tr>
390
+ <td>
391
+ <pre class="lines">
392
+
393
+
394
+ 42
395
+ 43
396
+ 44
397
+ 45
398
+ 46
399
+ 47
400
+ 48
401
+ 49
402
+ 50
403
+ 51</pre>
404
+ </td>
405
+ <td>
406
+ <pre class="code"><span class="info file"># File 'lib/tango/resource/buffer.rb', line 42</span>
407
+
408
+ <span class='kw'>def</span> <span class='id identifier rubyid_fill'>fill</span><span class='lparen'>(</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_resource'>resource</span> <span class='rparen'>)</span>
409
+
410
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Trying to fill object with unregistered type</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='ivar'>@resources</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span> <span class='id identifier rubyid_type'>type</span> <span class='rparen'>)</span>
411
+
412
+ <span class='comment'># Append resource to the buffer
413
+ </span> <span class='ivar'>@resources</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_resource'>resource</span>
414
+ <span class='comment'># Release the buffer if buffer size exceeded
415
+ </span> <span class='id identifier rubyid_release'>release</span><span class='lparen'>(</span> <span class='id identifier rubyid_type'>type</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@resources</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>&gt;=</span> <span class='ivar'>@size</span>
416
+
417
+ <span class='kw'>end</span></pre>
418
+ </td>
419
+ </tr>
420
+ </table>
421
+ </div>
422
+
423
+ <div class="method_details ">
424
+ <h3 class="signature " id="register-instance_method">
425
+
426
+ - (<tt>Object</tt>) <strong>register</strong>(type, &amp;release_callback)
427
+
428
+
429
+
430
+
431
+
432
+ </h3><div class="docstring">
433
+ <div class="discussion">
434
+
435
+ <p>Register new type of resource to be buffered</p>
436
+
437
+
438
+ </div>
439
+ </div>
440
+ <div class="tags">
441
+ <p class="tag_title">Parameters:</p>
442
+ <ul class="param">
443
+
444
+ <li>
445
+
446
+ <span class='name'>type</span>
447
+
448
+
449
+ <span class='type'>(<tt>Symbol</tt>)</span>
450
+
451
+
452
+
453
+ </li>
454
+
455
+ <li>
456
+
457
+ <span class='name'>release_callback</span>
458
+
459
+
460
+ <span class='type'>(<tt>Proc</tt>)</span>
461
+
462
+
463
+
464
+ </li>
465
+
466
+ </ul>
467
+
468
+ <p class="tag_title">Raises:</p>
469
+ <ul class="raise">
470
+
471
+ <li>
472
+
473
+
474
+ <span class='type'>(<tt>ArgumentError</tt>)</span>
475
+
476
+
477
+
478
+ </li>
479
+
480
+ </ul>
481
+
482
+ </div><table class="source_code">
483
+ <tr>
484
+ <td>
485
+ <pre class="lines">
486
+
487
+
488
+ 29
489
+ 30
490
+ 31
491
+ 32
492
+ 33
493
+ 34
494
+ 35
495
+ 36</pre>
496
+ </td>
497
+ <td>
498
+ <pre class="code"><span class="info file"># File 'lib/tango/resource/buffer.rb', line 29</span>
499
+
500
+ <span class='kw'>def</span> <span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_release_callback'>release_callback</span> <span class='rparen'>)</span>
501
+
502
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>No release callback given</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
503
+
504
+ <span class='ivar'>@resources</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
505
+ <span class='ivar'>@callbacks</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_release_callback'>release_callback</span>
506
+
507
+ <span class='kw'>end</span></pre>
508
+ </td>
509
+ </tr>
510
+ </table>
511
+ </div>
512
+
513
+ <div class="method_details ">
514
+ <h3 class="signature " id="release_all-instance_method">
515
+
516
+ - (<tt>Object</tt>) <strong>release_all</strong>
517
+
518
+
519
+
520
+
521
+
522
+ </h3><div class="docstring">
523
+ <div class="discussion">
524
+
525
+ <p>Release all registered buffers</p>
526
+
527
+
528
+ </div>
529
+ </div>
530
+ <div class="tags">
531
+
532
+
533
+ </div><table class="source_code">
534
+ <tr>
535
+ <td>
536
+ <pre class="lines">
537
+
538
+
539
+ 54
540
+ 55
541
+ 56</pre>
542
+ </td>
543
+ <td>
544
+ <pre class="code"><span class="info file"># File 'lib/tango/resource/buffer.rb', line 54</span>
545
+
546
+ <span class='kw'>def</span> <span class='id identifier rubyid_release_all'>release_all</span>
547
+ <span class='ivar'>@resources</span><span class='period'>.</span><span class='id identifier rubyid_keys'>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_type'>type</span><span class='op'>|</span> <span class='id identifier rubyid_release'>release</span><span class='lparen'>(</span> <span class='id identifier rubyid_type'>type</span> <span class='rparen'>)</span> <span class='rbrace'>}</span>
548
+ <span class='kw'>end</span></pre>
549
+ </td>
550
+ </tr>
551
+ </table>
552
+ </div>
553
+
554
+ </div>
555
+
556
+ </div>
557
+
558
+ <div id="footer">
559
+ Generated on Tue Apr 15 02:47:42 2014 by
560
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
561
+ 0.8.7.4 (ruby-2.0.0).
562
+ </div>
563
+
564
+ </body>
565
+ </html>