istox 0.1.121 → 0.1.122

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d27888d635b9229df92ed4d90664ab6bc7044cb5331d2ff3c341e67d47cac231
4
- data.tar.gz: 5a0775d137f02efe63ce485f3690ac931fe5d42b62a29a37579e4c767da62a5b
3
+ metadata.gz: b2ec2c5ce319ec743b9a544670ee7a9b88d9bcec272e6804225164bffd5fa169
4
+ data.tar.gz: 9448bcab2ec166a6dbc20106634389e7823f9e68ae4b9e2b16fe3ce66adfc34d
5
5
  SHA512:
6
- metadata.gz: e379ded62d5e5fd1a9ee839805449e5da2e78c54bd04b7ed1267e2b916b611b02b4a2fbb2f098ec63a6e20d0cf3f22a87fb52eb29c26fe574e6d02310c021ecb
7
- data.tar.gz: 1d0a8bdd7c3fd33b33c69147dbb3e1551eebd692b217a70aace3d073c254d352719e77bb4bd5a15fcd4a1ea77fc31aed2c03fcf58735171f8603cc14d8952665
6
+ metadata.gz: 3b795bc2d296992bbcff25d7450b5988c3b366c1697062e3f9dfd2e47e4366e599ceeb943573d729165424ec15861e01a8afc027b526e70e3b86150391607319
7
+ data.tar.gz: 80c81fab54f0516cf93af8afb9469ab61fc247e7813c90fd003f864c3bece24039c0b925d61d5fcee21940bf6158de54509e75229adb86970461740e289db996
data/.idea/istox-gem.iml CHANGED
@@ -250,26 +250,26 @@
250
250
  </library>
251
251
  </orderEntry>
252
252
  <orderEntry type="module-library">
253
- <library name="builder (vbundled(3.2.3)) [path][gem]" type="rubylib">
253
+ <library name="builder (vbundled(3.2.4)) [path][gem]" type="rubylib">
254
254
  <properties>
255
255
  <option name="version" value="4" />
256
256
  </properties>
257
257
  <CLASSES>
258
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/doc" />
259
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/lib" />
260
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/test" />
261
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/rakelib" />
258
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/doc" />
259
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/lib" />
260
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/test" />
261
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/rakelib" />
262
262
  </CLASSES>
263
263
  <SOURCES>
264
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/doc" />
265
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/lib" />
266
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/test" />
267
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/rakelib" />
264
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/doc" />
265
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/lib" />
266
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/test" />
267
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/rakelib" />
268
268
  </SOURCES>
269
269
  <excluded>
270
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/doc" />
271
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/test" />
272
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.3/rakelib" />
270
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/doc" />
271
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/test" />
272
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/builder-3.2.4/rakelib" />
273
273
  </excluded>
274
274
  </library>
275
275
  </orderEntry>
@@ -334,39 +334,34 @@
334
334
  </library>
335
335
  </orderEntry>
336
336
  <orderEntry type="module-library">
337
- <library name="concurrent-ruby (vbundled(1.1.4)) [path][gem]" type="rubylib">
337
+ <library name="concurrent-ruby (vbundled(1.1.5)) [path][gem]" type="rubylib">
338
338
  <properties>
339
339
  <option name="version" value="4" />
340
340
  </properties>
341
341
  <CLASSES>
342
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.4/ext" />
343
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.4/lib" />
342
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.5/ext" />
343
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.5/lib" />
344
344
  </CLASSES>
345
345
  <SOURCES>
346
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.4/ext" />
347
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.4/lib" />
346
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.5/ext" />
347
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.5/lib" />
348
348
  </SOURCES>
349
349
  <excluded>
350
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.4/ext" />
350
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/concurrent-ruby-1.1.5/ext" />
351
351
  </excluded>
352
352
  </library>
353
353
  </orderEntry>
354
354
  <orderEntry type="module-library">
355
- <library name="crass (vbundled(1.0.4)) [path][gem]" type="rubylib">
355
+ <library name="crass (vbundled(1.0.6)) [path][gem]" type="rubylib">
356
356
  <properties>
357
357
  <option name="version" value="4" />
358
358
  </properties>
359
359
  <CLASSES>
360
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/crass-1.0.4/lib" />
361
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/crass-1.0.4/test" />
360
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/crass-1.0.6/lib" />
362
361
  </CLASSES>
363
362
  <SOURCES>
364
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/crass-1.0.4/lib" />
365
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/crass-1.0.4/test" />
363
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/crass-1.0.6/lib" />
366
364
  </SOURCES>
367
- <excluded>
368
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/crass-1.0.4/test" />
369
- </excluded>
370
365
  </library>
371
366
  </orderEntry>
372
367
  <orderEntry type="module-library">
@@ -441,20 +436,20 @@
441
436
  </library>
442
437
  </orderEntry>
443
438
  <orderEntry type="module-library">
444
- <library name="erubi (vbundled(1.8.0)) [path][gem]" type="rubylib">
439
+ <library name="erubi (vbundled(1.9.0)) [path][gem]" type="rubylib">
445
440
  <properties>
446
441
  <option name="version" value="4" />
447
442
  </properties>
448
443
  <CLASSES>
449
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.8.0/lib" />
450
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.8.0/test" />
444
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.9.0/lib" />
445
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.9.0/test" />
451
446
  </CLASSES>
452
447
  <SOURCES>
453
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.8.0/lib" />
454
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.8.0/test" />
448
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.9.0/lib" />
449
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.9.0/test" />
455
450
  </SOURCES>
456
451
  <excluded>
457
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.8.0/test" />
452
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/erubi-1.9.0/test" />
458
453
  </excluded>
459
454
  </library>
460
455
  </orderEntry>
@@ -811,23 +806,23 @@
811
806
  </library>
812
807
  </orderEntry>
813
808
  <orderEntry type="module-library">
814
- <library name="loofah (vbundled(2.2.3)) [path][gem]" type="rubylib">
809
+ <library name="loofah (vbundled(2.4.0)) [path][gem]" type="rubylib">
815
810
  <properties>
816
811
  <option name="version" value="4" />
817
812
  </properties>
818
813
  <CLASSES>
819
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.2.3/lib" />
820
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.2.3/test" />
821
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.2.3/benchmark" />
814
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.4.0/lib" />
815
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.4.0/test" />
816
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.4.0/benchmark" />
822
817
  </CLASSES>
823
818
  <SOURCES>
824
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.2.3/lib" />
825
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.2.3/test" />
826
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.2.3/benchmark" />
819
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.4.0/lib" />
820
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.4.0/test" />
821
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.4.0/benchmark" />
827
822
  </SOURCES>
828
823
  <excluded>
829
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.2.3/test" />
830
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.2.3/benchmark" />
824
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.4.0/test" />
825
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/loofah-2.4.0/benchmark" />
831
826
  </excluded>
832
827
  </library>
833
828
  </orderEntry>
@@ -939,20 +934,20 @@
939
934
  </library>
940
935
  </orderEntry>
941
936
  <orderEntry type="module-library">
942
- <library name="minitest (vbundled(5.11.3)) [path][gem]" type="rubylib">
937
+ <library name="minitest (vbundled(5.14.0)) [path][gem]" type="rubylib">
943
938
  <properties>
944
939
  <option name="version" value="4" />
945
940
  </properties>
946
941
  <CLASSES>
947
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.11.3/lib" />
948
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.11.3/test" />
942
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.14.0/lib" />
943
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.14.0/test" />
949
944
  </CLASSES>
950
945
  <SOURCES>
951
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.11.3/lib" />
952
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.11.3/test" />
946
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.14.0/lib" />
947
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.14.0/test" />
953
948
  </SOURCES>
954
949
  <excluded>
955
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.11.3/test" />
950
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/minitest-5.14.0/test" />
956
951
  </excluded>
957
952
  </library>
958
953
  </orderEntry>
@@ -1002,26 +997,26 @@
1002
997
  </library>
1003
998
  </orderEntry>
1004
999
  <orderEntry type="module-library">
1005
- <library name="nokogiri (vbundled(1.10.1)) [path][gem]" type="rubylib">
1000
+ <library name="nokogiri (vbundled(1.10.7)) [path][gem]" type="rubylib">
1006
1001
  <properties>
1007
1002
  <option name="version" value="4" />
1008
1003
  </properties>
1009
1004
  <CLASSES>
1010
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/bin" />
1011
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/ext" />
1012
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/lib" />
1013
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/patches" />
1005
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/bin" />
1006
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/ext" />
1007
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/lib" />
1008
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/patches" />
1014
1009
  </CLASSES>
1015
1010
  <SOURCES>
1016
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/bin" />
1017
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/ext" />
1018
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/lib" />
1019
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/patches" />
1011
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/bin" />
1012
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/ext" />
1013
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/lib" />
1014
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/patches" />
1020
1015
  </SOURCES>
1021
1016
  <excluded>
1022
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/bin" />
1023
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/ext" />
1024
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.1/patches" />
1017
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/bin" />
1018
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/ext" />
1019
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/nokogiri-1.10.7/patches" />
1025
1020
  </excluded>
1026
1021
  </library>
1027
1022
  </orderEntry>
@@ -1086,29 +1081,26 @@
1086
1081
  </library>
1087
1082
  </orderEntry>
1088
1083
  <orderEntry type="module-library">
1089
- <library name="rack (vbundled(2.0.6)) [path][gem]" type="rubylib">
1084
+ <library name="rack (vbundled(2.1.2)) [path][gem]" type="rubylib">
1090
1085
  <properties>
1091
1086
  <option name="version" value="4" />
1092
1087
  </properties>
1093
1088
  <CLASSES>
1094
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/bin" />
1095
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/lib" />
1096
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/test" />
1097
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/contrib" />
1098
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/example" />
1089
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/bin" />
1090
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/lib" />
1091
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/contrib" />
1092
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/example" />
1099
1093
  </CLASSES>
1100
1094
  <SOURCES>
1101
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/bin" />
1102
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/lib" />
1103
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/test" />
1104
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/contrib" />
1105
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/example" />
1095
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/bin" />
1096
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/lib" />
1097
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/contrib" />
1098
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/example" />
1106
1099
  </SOURCES>
1107
1100
  <excluded>
1108
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/bin" />
1109
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/test" />
1110
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/contrib" />
1111
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.0.6/example" />
1101
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/bin" />
1102
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/contrib" />
1103
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rack-2.1.2/example" />
1112
1104
  </excluded>
1113
1105
  </library>
1114
1106
  </orderEntry>
@@ -1153,20 +1145,20 @@
1153
1145
  </library>
1154
1146
  </orderEntry>
1155
1147
  <orderEntry type="module-library">
1156
- <library name="rails-html-sanitizer (vbundled(1.0.4)) [path][gem]" type="rubylib">
1148
+ <library name="rails-html-sanitizer (vbundled(1.3.0)) [path][gem]" type="rubylib">
1157
1149
  <properties>
1158
1150
  <option name="version" value="4" />
1159
1151
  </properties>
1160
1152
  <CLASSES>
1161
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.0.4/lib" />
1162
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.0.4/test" />
1153
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.3.0/lib" />
1154
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.3.0/test" />
1163
1155
  </CLASSES>
1164
1156
  <SOURCES>
1165
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.0.4/lib" />
1166
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.0.4/test" />
1157
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.3.0/lib" />
1158
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.3.0/test" />
1167
1159
  </SOURCES>
1168
1160
  <excluded>
1169
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.0.4/test" />
1161
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/rails-html-sanitizer-1.3.0/test" />
1170
1162
  </excluded>
1171
1163
  </library>
1172
1164
  </orderEntry>
@@ -1268,20 +1260,29 @@
1268
1260
  </library>
1269
1261
  </orderEntry>
1270
1262
  <orderEntry type="module-library">
1271
- <library name="redis-actionpack (vbundled(5.1.0)) [path][gem]" type="rubylib">
1263
+ <library name="redis-actionpack (vbundled(5.2.0)) [path][gem]" type="rubylib">
1272
1264
  <properties>
1273
1265
  <option name="version" value="4" />
1274
1266
  </properties>
1275
1267
  <CLASSES>
1276
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.1.0/lib" />
1277
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.1.0/test" />
1268
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/bin" />
1269
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/lib" />
1270
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/test" />
1271
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/.github" />
1272
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/gemfiles" />
1278
1273
  </CLASSES>
1279
1274
  <SOURCES>
1280
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.1.0/lib" />
1281
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.1.0/test" />
1275
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/bin" />
1276
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/lib" />
1277
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/test" />
1278
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/.github" />
1279
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/gemfiles" />
1282
1280
  </SOURCES>
1283
1281
  <excluded>
1284
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.1.0/test" />
1282
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/bin" />
1283
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/test" />
1284
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/.github" />
1285
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-actionpack-5.2.0/gemfiles" />
1285
1286
  </excluded>
1286
1287
  </library>
1287
1288
  </orderEntry>
@@ -1325,29 +1326,26 @@
1325
1326
  </library>
1326
1327
  </orderEntry>
1327
1328
  <orderEntry type="module-library">
1328
- <library name="redis-rack (vbundled(2.0.6)) [path][gem]" type="rubylib">
1329
+ <library name="redis-rack (vbundled(2.1.0)) [path][gem]" type="rubylib">
1329
1330
  <properties>
1330
1331
  <option name="version" value="4" />
1331
1332
  </properties>
1332
1333
  <CLASSES>
1333
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/bin" />
1334
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/lib" />
1335
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/test" />
1336
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/.github" />
1337
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/gemfiles" />
1334
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/bin" />
1335
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/lib" />
1336
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/test" />
1337
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/.github" />
1338
1338
  </CLASSES>
1339
1339
  <SOURCES>
1340
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/bin" />
1341
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/lib" />
1342
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/test" />
1343
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/.github" />
1344
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/gemfiles" />
1340
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/bin" />
1341
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/lib" />
1342
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/test" />
1343
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/.github" />
1345
1344
  </SOURCES>
1346
1345
  <excluded>
1347
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/bin" />
1348
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/test" />
1349
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/.github" />
1350
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.0.6/gemfiles" />
1346
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/bin" />
1347
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/test" />
1348
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/redis-rack-2.1.0/.github" />
1351
1349
  </excluded>
1352
1350
  </library>
1353
1351
  </orderEntry>
@@ -1619,20 +1617,20 @@
1619
1617
  </library>
1620
1618
  </orderEntry>
1621
1619
  <orderEntry type="module-library">
1622
- <library name="tzinfo (vbundled(1.2.5)) [path][gem]" type="rubylib">
1620
+ <library name="tzinfo (vbundled(1.2.6)) [path][gem]" type="rubylib">
1623
1621
  <properties>
1624
1622
  <option name="version" value="4" />
1625
1623
  </properties>
1626
1624
  <CLASSES>
1627
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.5/lib" />
1628
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.5/test" />
1625
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.6/lib" />
1626
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.6/test" />
1629
1627
  </CLASSES>
1630
1628
  <SOURCES>
1631
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.5/lib" />
1632
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.5/test" />
1629
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.6/lib" />
1630
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.6/test" />
1633
1631
  </SOURCES>
1634
1632
  <excluded>
1635
- <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.5/test" />
1633
+ <root url="file://$MODULE_DIR$/vendor/ruby/2.5.0/gems/tzinfo-1.2.6/test" />
1636
1634
  </excluded>
1637
1635
  </library>
1638
1636
  </orderEntry>
data/.idea/workspace.xml CHANGED
@@ -4,6 +4,7 @@
4
4
  <list default="true" id="f70e0449-76c0-44d8-bcb9-7991f2a7e0f8" name="Default Changelist" comment="">
5
5
  <change beforePath="$PROJECT_DIR$/.idea/istox-gem.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/istox-gem.iml" afterDir="false" />
6
6
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
7
+ <change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile.lock" afterDir="false" />
7
8
  <change beforePath="$PROJECT_DIR$/lib/istox/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/istox/version.rb" afterDir="false" />
8
9
  </list>
9
10
  <option name="SHOW_DIALOG" value="false" />
@@ -69,6 +70,18 @@
69
70
  </list>
70
71
  </recent_temporary>
71
72
  </component>
73
+ <component name="ServiceViewManager">
74
+ <option name="viewStates">
75
+ <list>
76
+ <serviceView>
77
+ <treeState>
78
+ <expand />
79
+ <select />
80
+ </treeState>
81
+ </serviceView>
82
+ </list>
83
+ </option>
84
+ </component>
72
85
  <component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="false" RAILS_SPRING_PRE_LOADER_OPTION="false" />
73
86
  <component name="SvnConfiguration">
74
87
  <configuration />
@@ -90,7 +103,26 @@
90
103
  <workItem from="1580188100223" duration="29285000" />
91
104
  <workItem from="1580636078385" duration="150000" />
92
105
  <workItem from="1580636268918" duration="15217000" />
93
- <workItem from="1580778333268" duration="1359000" />
106
+ <workItem from="1580778333268" duration="38342000" />
107
+ <workItem from="1581417729768" duration="622000" />
108
+ <workItem from="1581997247028" duration="13298000" />
109
+ <workItem from="1582531415155" duration="2948000" />
110
+ <workItem from="1582721620073" duration="1020000" />
111
+ <workItem from="1582724056395" duration="121000" />
112
+ <workItem from="1582725579882" duration="410000" />
113
+ <workItem from="1582726229359" duration="130000" />
114
+ <workItem from="1582726580750" duration="184000" />
115
+ <workItem from="1582727163150" duration="3027000" />
116
+ <workItem from="1582731738723" duration="123000" />
117
+ <workItem from="1582733310576" duration="1118000" />
118
+ <workItem from="1582763652048" duration="4024000" />
119
+ <workItem from="1582769446142" duration="100000" />
120
+ <workItem from="1582769955751" duration="343000" />
121
+ <workItem from="1582772331852" duration="114000" />
122
+ <workItem from="1582772517220" duration="167000" />
123
+ <workItem from="1582773229066" duration="1054000" />
124
+ <workItem from="1582775256351" duration="904000" />
125
+ <workItem from="1582776881393" duration="310000" />
94
126
  </task>
95
127
  <servers />
96
128
  </component>
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.1.121)
4
+ istox (0.1.122)
5
5
  awesome_print
6
6
  binding_of_caller
7
7
  bunny (>= 2.12.0)
@@ -69,18 +69,18 @@ GEM
69
69
  aws-eventstream (~> 1.0, >= 1.0.2)
70
70
  binding_of_caller (0.8.0)
71
71
  debug_inspector (>= 0.0.1)
72
- builder (3.2.3)
72
+ builder (3.2.4)
73
73
  bullet (5.7.6)
74
74
  activesupport (>= 3.0.0)
75
75
  uniform_notifier (~> 1.11.0)
76
76
  bunny (2.14.3)
77
77
  amq-protocol (~> 2.3, >= 2.3.0)
78
- concurrent-ruby (1.1.4)
79
- crass (1.0.4)
78
+ concurrent-ruby (1.1.5)
79
+ crass (1.0.6)
80
80
  database_cleaner (1.6.2)
81
81
  debug_inspector (0.0.3)
82
82
  diff-lcs (1.3)
83
- erubi (1.8.0)
83
+ erubi (1.9.0)
84
84
  factory_bot (4.8.2)
85
85
  activesupport (>= 3.0.0)
86
86
  factory_bot_rails (4.8.2)
@@ -130,7 +130,7 @@ GEM
130
130
  listen (3.0.8)
131
131
  rb-fsevent (~> 0.9, >= 0.9.4)
132
132
  rb-inotify (~> 0.9, >= 0.9.7)
133
- loofah (2.2.3)
133
+ loofah (2.4.0)
134
134
  crass (~> 1.0.2)
135
135
  nokogiri (>= 1.5.9)
136
136
  mail (2.7.1)
@@ -141,17 +141,17 @@ GEM
141
141
  mimemagic (0.3.3)
142
142
  mini_mime (1.0.1)
143
143
  mini_portile2 (2.4.0)
144
- minitest (5.11.3)
144
+ minitest (5.14.0)
145
145
  multipart-post (2.1.1)
146
146
  nio4r (2.3.1)
147
- nokogiri (1.10.1)
147
+ nokogiri (1.10.7)
148
148
  mini_portile2 (~> 2.4.0)
149
149
  oj (3.10.2)
150
150
  ougai (1.8.2)
151
151
  oj (~> 3.4)
152
152
  paranoia (2.4.2)
153
153
  activerecord (>= 4.0, < 6.1)
154
- rack (2.0.6)
154
+ rack (2.1.2)
155
155
  rack-test (1.1.0)
156
156
  rack (>= 1.0, < 3)
157
157
  rails (5.2.2)
@@ -170,8 +170,8 @@ GEM
170
170
  rails-dom-testing (2.0.3)
171
171
  activesupport (>= 4.2.0)
172
172
  nokogiri (>= 1.6)
173
- rails-html-sanitizer (1.0.4)
174
- loofah (~> 2.2, >= 2.2.2)
173
+ rails-html-sanitizer (1.3.0)
174
+ loofah (~> 2.3)
175
175
  railties (5.2.2)
176
176
  actionpack (= 5.2.2)
177
177
  activesupport (= 5.2.2)
@@ -183,17 +183,17 @@ GEM
183
183
  rb-inotify (0.10.1)
184
184
  ffi (~> 1.0)
185
185
  redis (4.1.3)
186
- redis-actionpack (5.1.0)
187
- actionpack (>= 4.0, < 7)
188
- redis-rack (>= 1, < 3)
186
+ redis-actionpack (5.2.0)
187
+ actionpack (>= 5, < 7)
188
+ redis-rack (>= 2.1.0, < 3)
189
189
  redis-store (>= 1.1.0, < 2)
190
190
  redis-activesupport (5.2.0)
191
191
  activesupport (>= 3, < 7)
192
192
  redis-store (>= 1.3, < 2)
193
193
  redis-namespace (1.7.0)
194
194
  redis (>= 3.0.4)
195
- redis-rack (2.0.6)
196
- rack (>= 1.5, < 3)
195
+ redis-rack (2.1.0)
196
+ rack (>= 2.0.8, < 3)
197
197
  redis-store (>= 1.2, < 2)
198
198
  redis-rails (5.0.2)
199
199
  redis-actionpack (>= 5.0, < 6)
@@ -234,7 +234,7 @@ GEM
234
234
  thor (0.20.3)
235
235
  thread_safe (0.3.6)
236
236
  timecop (0.9.1)
237
- tzinfo (1.2.5)
237
+ tzinfo (1.2.6)
238
238
  thread_safe (~> 0.1)
239
239
  uniform_notifier (1.11.0)
240
240
  vault (0.13.0)
@@ -38,12 +38,18 @@ module Istox
38
38
  type = data[:exchanges][eid][:type]
39
39
  name = eid
40
40
  settings = { durable: data[:exchanges][eid][:durable] || false }
41
- confirm = data[:exchanges][eid][:confirm] || false
41
+ confirm = data[:exchanges][eid][:confirm] || -1
42
42
  [type, name, settings, confirm]
43
43
  rescue
44
44
  nil
45
45
  end
46
46
 
47
+ def confirm_mode(eid)
48
+ data[:exchanges][eid][:confirm] || -1
49
+ rescue
50
+ nil
51
+ end
52
+
47
53
  def queues_keys_for_subscribe()
48
54
  data['queues'].keys
49
55
  end
@@ -96,6 +102,13 @@ module Istox
96
102
  nil
97
103
  end
98
104
 
105
+ def queue_single_consumer?(consumer_key)
106
+ single_consumer = queue_config_from_consumer_key!(consumer_key)['single_consumer']
107
+ return false if single_consumer.nil?
108
+
109
+ single_consumer
110
+ end
111
+
99
112
  # Default value: belonged exchange durable attr
100
113
  def queue_durable?(consumer_key)
101
114
  durable = queue_config_from_consumer_key!(consumer_key)['durable']
@@ -176,6 +189,28 @@ module Istox
176
189
  options[:message_id]
177
190
  end
178
191
 
192
+ def queue_ok?(conn, name)
193
+ Logger "queue_ok? #{name}"
194
+ ch = conn.create_channel
195
+ begin
196
+ q = ch.queue(name, passive: true)
197
+ count = q.consumer_count
198
+ log.debug "Consumer count number is #{count}"
199
+ if count.zero?
200
+ log.debug "queue #{name} has no consumer, ok!"
201
+ true
202
+ else
203
+ log.debug "queue #{name} has consumer, nok!"
204
+ false
205
+ end
206
+ rescue Bunny::NotFound => e
207
+ log.debug "Bunny::NotFound, #{e}"
208
+ false
209
+ ensure
210
+ ch.close if ch.open?
211
+ end
212
+ end
213
+
179
214
  private
180
215
 
181
216
  def data
@@ -64,12 +64,34 @@ module Istox
64
64
  def channel
65
65
  return @channel[Thread.current.object_id] if @channel.present? && @channel[Thread.current.object_id].present?
66
66
 
67
- log.info 'No channel yet, create 2 channels confirm-mode and non-confirm-mode ... ...'
67
+ log.info "#{Thread.current.object_id} No channel yet, create 2 channels confirm-mode and non-confirm-mode ... ..."
68
68
  @channel = Hash.new if @channel.nil?
69
69
  @channel[Thread.current.object_id] = Hash.new
70
- @channel[Thread.current.object_id]['confirm'] = ::Istox::BunnyBoot.channel(connection, confirm: true)
70
+ @channel[Thread.current.object_id]['confirm-0'] = ::Istox::BunnyBoot.channel(connection, confirm: true)
71
+ @channel[Thread.current.object_id]['confirm-1'] = ::Istox::BunnyBoot.channel(connection, confirm: true)
71
72
  @channel[Thread.current.object_id]['noconfirm'] = ::Istox::BunnyBoot.channel(connection, confirm: false)
72
73
 
74
+ threadId = Thread.current.object_id
75
+ # Start new thread on receiving ACK from 'confirm-1' channel on the specified thread
76
+ Thread.new do
77
+ loop do
78
+ log.debug "[Async #{threadId}] Confirm mode channel, wait for confirmation"
79
+ success = @channel[threadId]['confirm-1'].wait_for_confirms
80
+ if success
81
+ log.debug "[Async] Confirm mode result: #{success}"
82
+ ::Istox::RedisBoot.flushdb
83
+ else
84
+ @channel[threadId]['confirm-1'].nacked_set.each do |n|
85
+ log.debug "[Async #{threadId}] Confirm mode UnAcked Delivery Tag: #{n}"
86
+ ::Istox::RedisBoot.incr("confirm:#{n.to_s}")
87
+ publish(exchange: ex.name, routing_key: routing_key, message: message, )
88
+ end
89
+ end
90
+
91
+ sleep 2
92
+ end
93
+ end
94
+
73
95
  @channel[Thread.current.object_id]
74
96
  end
75
97
 
@@ -90,23 +112,23 @@ module Istox
90
112
  end
91
113
  end
92
114
 
93
- # return confirm-mode chanel for current thread
94
- def channel_confirm_mode
95
- channel['confirm']
96
- # channel_fake
115
+ def channel_from_mode(mode)
116
+ if mode == 0 || mode == 1
117
+ channel["confirm-#{mode.to_s}"]
118
+ else
119
+ channel['noconfirm']
120
+ end
97
121
  end
98
122
 
99
- # return no-confirm-mode chanel for current thread
100
- def channel_noconfirm_mode
101
- channel['noconfirm']
102
- # channel_fake
123
+ def confirm_mode(eid)
124
+ ::Istox::BunnyBoot.confirm_mode eid
103
125
  end
104
126
 
105
127
  def exchanges
106
128
  return @exchanges[Thread.current.object_id] if @exchanges.present? && @exchanges[Thread.current.object_id].present?
107
129
 
108
130
  @exchanges = Hash.new if @exchanges.nil?
109
- @exchanges[Thread.current.object_id] = { default: channel['confirm'].default_exchange }
131
+ @exchanges[Thread.current.object_id] = { default: channel['confirm-1'].default_exchange }
110
132
 
111
133
  @exchanges[Thread.current.object_id]
112
134
  # @exchanges ||= { default: channel['confirm'].default_exchange }
@@ -119,7 +141,8 @@ module Istox
119
141
  log.info "Declare exchange #{id} on channel"
120
142
  e = ::Istox::BunnyBoot.exchange(id)
121
143
  e = [type, id, { durable: durable || true }, options['publish_confirm'] || true] if e.nil?
122
- c = e.pop ? channel_confirm_mode : channel_noconfirm_mode
144
+
145
+ c = channel_from_mode e.pop
123
146
  ex = c.send *e
124
147
 
125
148
  # For mandatory flag, listen to returned message
@@ -161,17 +184,16 @@ module Istox
161
184
  # update_message_tracker(message_id, delivery_tag, 0, message)
162
185
  end
163
186
 
187
+ create_tracker message_id, delivery_tag, 0, message if ex.channel.using_publisher_confirmations?
164
188
  ::Istox::BunnyBoot.publish(ex, message, routing_key: routing_key, message_id: message_id, type: 'manual')
165
189
 
166
- if ex.channel.using_publisher_confirmations?
167
- log.debug 'Confirm mode channel, wait for confirmation'
190
+ if ex.channel.using_publisher_confirmations? && confirm_mode(ex.name) == 0
168
191
  success = ex.channel.wait_for_confirms
169
192
  if success
170
- log.debug "Confirm mode result: #{success}"
193
+ # Flush everything on Redis
171
194
  ::Istox::RedisBoot.flushdb
172
195
  else
173
196
  ex.channel.nacked_set.each do |n|
174
- log.debug "Confirm mode UnAcked Delivery Tag: #{n}"
175
197
  ::Istox::RedisBoot.incr("confirm:#{n.to_s}")
176
198
  publish(exchange: ex.name, routing_key: routing_key, message: message, )
177
199
  end
@@ -4,8 +4,8 @@ module Istox
4
4
  class RedisBoot
5
5
  class << self
6
6
 
7
- def set(k,v)
8
- redis.set(k,v)
7
+ def set(k,v, options = {})
8
+ redis.set(k,v, options)
9
9
  end
10
10
 
11
11
  def keys(p)
@@ -24,12 +24,24 @@ module Istox
24
24
  redis.incr(k)
25
25
  end
26
26
 
27
+ def lock(key, timeout = 3600)
28
+ loop do
29
+ break if set(key, 1, nx: true, px: timeout)
30
+ end
31
+
32
+ begin
33
+ yield
34
+ ensure
35
+ del key
36
+ end
37
+ end
38
+
27
39
  private
28
40
 
29
- def redis
41
+ def redis(db = 4)
30
42
  @redis ||= Redis.new(
31
43
  url: ENV["REDIS_URL"] || 'redis://127.0.0.1',
32
- db: 4
44
+ db: db
33
45
  )
34
46
  end
35
47
  end
@@ -8,81 +8,108 @@ module Istox
8
8
  # optionally can pass in consumer_key for single subscription / consumer_keys for multiple subcriptions
9
9
  # consumer_key must be defined in amqp.yml
10
10
  # if nothing pass in it will auto subscribe to all available consumers defined in amqp.yml queues key
11
- def subscribe
11
+ def start_subscribe(subscribing_consumer_keys = [])
12
12
  return if @flag
13
13
 
14
14
  @mutex = Mutex.new unless @mutex.present?
15
15
  @mutex.synchronize do
16
16
  return if @flag
17
- =begin
18
- subscribing_consumer_keys = consumer_keys.present? ? consumer_keys : []
19
17
 
20
- if subscribing_consumer_keys.empty? && consumer_key.nil?
21
- subscribing_consumer_keys = ::Istox::BunnyBoot.queues_keys_for_subscribe
22
- elsif subscribing_consumer_keys.empty? && consumer_key.present?
23
- subscribing_consumer_keys = [consumer_key]
24
- end
25
- =end
26
- subscribing_consumer_keys = ::Istox::BunnyBoot.queues_keys_for_subscribe
18
+ subscribing_consumer_keys = ::Istox::BunnyBoot.queues_keys_for_subscribe if subscribing_consumer_keys.empty?
27
19
  subscribing_consumer_keys.each do |key|
28
- log.debug "Do subscribe key #{key.to_s}"
29
- do_subscribe(key.to_s)
20
+ log.debug "Do subscribe key #{key}"
21
+ if key.is_a?(String)
22
+ do_subscribe key.to_s
23
+ elsif key.is_a?(Hash)
24
+ do_subscribe key[:id], key[:suffix], key[:multiple]
25
+ end
30
26
  end
31
27
 
32
28
  @flag = true
33
29
  end
34
30
  end
35
31
 
32
+ def get_channels
33
+ @chs
34
+ end
35
+
36
36
  private
37
37
 
38
- def do_subscribe(consumer_key)
38
+ def do_subscribe(consumer_key, suffix = nil, multiple = nil)
39
39
  manual_ack = ::Istox::BunnyBoot.queue_manual_ack? consumer_key
40
40
 
41
41
  # Create Channel with specified pool_size and prefetch
42
42
  pool_size = ::Istox::BunnyBoot.channel_pool_size consumer_key
43
43
  prefetch = ::Istox::BunnyBoot.channel_prefetch consumer_key
44
- active_channel = ::Istox::BunnyBoot.channel(::Istox::BunnyBoot.connection, pool_size: pool_size, prefetch: prefetch)
44
+ conn = ::Istox::BunnyBoot.connection
45
+ active_channel = ::Istox::BunnyBoot.channel(conn, pool_size: pool_size, prefetch: prefetch)
46
+ @chs = [] if @chs.nil?
47
+ @chs << active_channel
48
+
49
+ # Declare queue and bind to exchange
50
+ queue_name = ::Istox::BunnyBoot.queue_name consumer_key
51
+ queue_name = "#{queue_name}.#{suffix}" unless suffix.nil?
52
+ queue_durable = ::Istox::BunnyBoot.queue_durable? consumer_key
53
+ begin
54
+ queue = active_channel.queue(queue_name, durable: queue_durable)
55
+ rescue Bunny::PreconditionFailed => e
56
+ # Must re-open a new channel, because now channel is already closed
57
+ active_channel = ::Istox::BunnyBoot.channel(::Istox::BunnyBoot.connection, pool_size: pool_size, prefetch: prefetch)
58
+ active_channel.queue_delete(queue_name)
59
+ queue = active_channel.queue(queue_name, durable: queue_durable)
60
+ end
45
61
 
46
62
  # Declare exchange
47
63
  exchange_name = ::Istox::BunnyBoot.exchange_name consumer_key
48
- exchange_retry_name = if manual_ack
49
- "#{exchange_name}.retry"
50
- else
51
- nil
52
- end
53
- exchange_name = ::Istox::BunnyBoot.exchange_name consumer_key
54
- exchange_durable = ::Istox::BunnyBoot.exchange_durable? exchange_name
55
- exchange_type = ::Istox::BunnyBoot.exchange_type exchange_name
56
- case exchange_type
57
- when 'fanout'
58
- exchange = active_channel.fanout(exchange_name, durable: exchange_durable)
59
- exchange_retry = if exchange_retry_name.nil?
60
- nil
61
- else
62
- active_channel.fanout(exchange_retry_name, durable: exchange_durable)
63
- end
64
- when 'direct'
65
- exchange = active_channel.direct(exchange_name, durable: exchange_durable)
66
- exchange_retry = if exchange_retry_name.nil?
67
- nil
68
- else
69
- active_channel.direct(exchange_retry_name, durable: exchange_durable)
70
- end
71
- else
72
- raise "Exchange type #{exchange_type} is not valid/supported."
64
+ unless exchange_name.nil?
65
+ exchange_name = ::Istox::BunnyBoot.exchange_name consumer_key
66
+ exchange_durable = ::Istox::BunnyBoot.exchange_durable? exchange_name
67
+ exchange_type = ::Istox::BunnyBoot.exchange_type exchange_name
68
+
69
+ begin
70
+ exchange = active_channel.send exchange_type, exchange_name, durable: exchange_durable
71
+ rescue NoMethodError => e
72
+ log.error e
73
+ raise "Exchange type #{exchange_type} is not valid/supported."
74
+ end
75
+
76
+ # Bind queue to exchange
77
+ queue_options = {}
78
+ queue_options[:routing_key] = queue_name if exchange_type == 'direct' || exchange_type == 'topic'
79
+ queue.bind exchange, queue_options
73
80
  end
74
81
 
75
- # Declare queue and bind to exchange
76
- queue_name = ::Istox::BunnyBoot.queue_name consumer_key
77
- queue_durable = ::Istox::BunnyBoot.queue_durable? consumer_key
78
- queue_options = {}
79
- queue_options[:routing_key] = queue_name if exchange_type == 'direct'
80
- queue = active_channel.queue(queue_name, durable: queue_durable).bind(exchange, queue_options)
81
- active_channel.queue("#{queue_name}.retry", arguments: {
82
- 'x-dead-letter-exchange': exchange.name,
83
- 'x-dead-letter-routing-key': "#{queue_name}",
84
- 'x-message-ttl': (::Istox::BunnyBoot.queue_retry_gap consumer_key)
85
- }).bind(exchange_retry, routing_key: "#{queue_name}.retry") if manual_ack
82
+ if manual_ack
83
+ if exchange.nil?
84
+ letter_exchange = active_channel.default_exchange.name
85
+ else
86
+ letter_exchange = exchange.name
87
+ end
88
+ retry_queue = active_channel.queue("#{queue_name}.retry", arguments: {
89
+ 'x-dead-letter-exchange': letter_exchange,
90
+ 'x-dead-letter-routing-key': "#{queue_name}",
91
+ 'x-message-ttl': (::Istox::BunnyBoot.queue_retry_gap consumer_key)
92
+ })
93
+ unless exchange_name.nil?
94
+ exchange_retry_name = "#{exchange_name}.retry"
95
+ exchange_retry = active_channel.send exchange_type, exchange_retry_name, durable: exchange_durable
96
+ retry_queue.bind exchange_retry, routing_key: "#{queue_name}.retry" if manual_ack
97
+ else
98
+ exchange_retry = active_channel.default_exchange
99
+ end
100
+ end
101
+
102
+ loop do
103
+ break unless ::Istox::BunnyBoot.queue_single_consumer? consumer_key
104
+
105
+ flag = false
106
+ ::Istox::RedisBoot.lock("peatio:#{consumer_key}:locking") do
107
+ flag = ::Istox::BunnyBoot.queue_ok? conn, queue.name
108
+ end
109
+ break if flag
110
+
111
+ sleep 2
112
+ end
86
113
 
87
114
  # Subscribe queue
88
115
  queue.subscribe manual_ack: manual_ack do |delivery_info, metadata, payload|
@@ -100,13 +127,20 @@ module Istox
100
127
  payload_object = ::Istox::CommonHelper.to_open_struct(processing_paylod)
101
128
 
102
129
  ruby_class = ::Istox::BunnyBoot.ruby_class consumer_key
130
+ log.debug "#{'::' + (ruby_class.nil? ? "#{consumer_key.to_s.underscore}_consumer" : ruby_class).camelize}"
103
131
  klass = Object.const_get(
104
132
  '::' + (ruby_class.nil? ? "#{consumer_key.to_s.underscore}_consumer" : ruby_class).camelize
105
133
  )
106
134
 
135
+ if suffix.nil?
136
+ worker = klass.new
137
+ else
138
+ worker = klass.new suffix
139
+ end
140
+
107
141
  log.info "Processing in consumer: #{klass}, paylod: #{payload_object.to_h.inspect}"
108
142
 
109
- klass.new.process(payload_object, metadata, delivery_info)
143
+ result = worker.process(payload_object, metadata, delivery_info)
110
144
  end
111
145
  # active_channel.ack(delivery_info.delivery_tag) if manual_ack
112
146
  rescue StandardError => e
@@ -130,9 +164,15 @@ module Istox
130
164
  active_channel.nack(delivery_info.delivery_tag, false, true)
131
165
  end
132
166
  =end
133
-
134
167
  ensure
135
- active_channel.ack(delivery_info.delivery_tag) if manual_ack
168
+ if manual_ack
169
+ if !multiple.nil? && !result && result == multiple
170
+ multiple = true
171
+ else
172
+ multiple = false
173
+ end
174
+ active_channel.ack(delivery_info.delivery_tag, multiple)
175
+ end
136
176
  end
137
177
  end
138
178
  end
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.121'.freeze
2
+ VERSION = '0.1.122'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.121
4
+ version: 0.1.122
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-04 00:00:00.000000000 Z
11
+ date: 2020-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print