iodine 0.7.59 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/.clang-format +15 -0
  3. data/.rspec +1 -0
  4. data/.yardopts +1 -3
  5. data/CHANGELOG.md +132 -12
  6. data/Gemfile +5 -7
  7. data/LICENSE.txt +1 -1
  8. data/README.md +147 -671
  9. data/Rakefile +9 -16
  10. data/examples/chatroom.nru +9 -0
  11. data/examples/client +74 -0
  12. data/examples/config-hello.nru +9 -0
  13. data/examples/config-hello.ru +11 -0
  14. data/examples/config-hijack.ru +13 -0
  15. data/examples/config-shootout.ru +43 -0
  16. data/examples/config.nru +120 -0
  17. data/examples/config.rb +37 -0
  18. data/examples/config.ru +42 -53
  19. data/examples/fake +24 -0
  20. data/examples/hello_neorack +137 -0
  21. data/examples/routes.nru +29 -0
  22. data/examples/routes.ru +42 -0
  23. data/exe/iodine +218 -258
  24. data/ext/iodine/extconf.rb +27 -100
  25. data/ext/iodine/fio-stl.h +128336 -0
  26. data/ext/iodine/fio-stl.md +26396 -0
  27. data/ext/iodine/iodine.c +213 -1393
  28. data/ext/iodine/iodine.h +250 -55
  29. data/ext/iodine/iodine_arg_helper.h +329 -0
  30. data/ext/iodine/iodine_caller.h +234 -25
  31. data/ext/iodine/iodine_cli.h +434 -0
  32. data/ext/iodine/iodine_compression.h +312 -0
  33. data/ext/iodine/iodine_connection.h +3484 -34
  34. data/ext/iodine/iodine_core.h +363 -0
  35. data/ext/iodine/iodine_crypto.h +1441 -0
  36. data/ext/iodine/iodine_defer.h +225 -4
  37. data/ext/iodine/iodine_json.h +738 -4
  38. data/ext/iodine/iodine_listener.h +263 -0
  39. data/ext/iodine/iodine_log.h +297 -0
  40. data/ext/iodine/iodine_minimap.h +543 -0
  41. data/ext/iodine/iodine_mustache.h +461 -4
  42. data/ext/iodine/iodine_pubsub_eng.h +729 -0
  43. data/ext/iodine/iodine_pubsub_history.h +547 -0
  44. data/ext/iodine/iodine_pubsub_msg.h +228 -0
  45. data/ext/iodine/iodine_redis.h +322 -0
  46. data/ext/iodine/iodine_store.h +418 -16
  47. data/ext/iodine/iodine_threads.h +279 -0
  48. data/ext/iodine/iodine_tls.h +515 -6
  49. data/ext/iodine/iodine_utils.h +923 -0
  50. data/iodine.gemspec +37 -42
  51. data/lib/iodine/benchmark.rb +1690 -0
  52. data/lib/iodine/documentation.rb +3085 -0
  53. data/lib/iodine/version.rb +17 -1
  54. data/lib/iodine.rb +54 -255
  55. data/logo.svg +36 -0
  56. data/mustache.md +55 -0
  57. data/sig/iodine.rbs +4 -0
  58. metadata +58 -184
  59. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -40
  60. data/.github/workflows/ruby.yml +0 -42
  61. data/.gitignore +0 -20
  62. data/LIMITS.md +0 -41
  63. data/SPEC-PubSub-Draft.md +0 -159
  64. data/SPEC-WebSocket-Draft.md +0 -239
  65. data/bin/console +0 -22
  66. data/bin/info.md +0 -353
  67. data/bin/mustache_bench.rb +0 -100
  68. data/bin/poc/Gemfile.lock +0 -23
  69. data/bin/poc/README.md +0 -37
  70. data/bin/poc/config.ru +0 -66
  71. data/bin/poc/gemfile +0 -1
  72. data/bin/poc/www/index.html +0 -57
  73. data/examples/async_task.ru +0 -92
  74. data/examples/bates/README.md +0 -3
  75. data/examples/bates/config.ru +0 -342
  76. data/examples/bates/david+bold.pdf +0 -0
  77. data/examples/bates/public/drop-pdf.png +0 -0
  78. data/examples/bates/public/index.html +0 -600
  79. data/examples/echo.ru +0 -59
  80. data/examples/etag.ru +0 -16
  81. data/examples/hello.ru +0 -29
  82. data/examples/pubsub_engine.ru +0 -81
  83. data/examples/rack3.ru +0 -12
  84. data/examples/redis.ru +0 -70
  85. data/examples/shootout.ru +0 -73
  86. data/examples/sub-protocols.ru +0 -90
  87. data/examples/tcp_client.rb +0 -66
  88. data/examples/x-sendfile.ru +0 -14
  89. data/ext/iodine/fio.c +0 -11995
  90. data/ext/iodine/fio.h +0 -6371
  91. data/ext/iodine/fio_cli.c +0 -431
  92. data/ext/iodine/fio_cli.h +0 -189
  93. data/ext/iodine/fio_json_parser.h +0 -688
  94. data/ext/iodine/fio_siphash.c +0 -157
  95. data/ext/iodine/fio_siphash.h +0 -37
  96. data/ext/iodine/fio_tls.h +0 -129
  97. data/ext/iodine/fio_tls_missing.c +0 -649
  98. data/ext/iodine/fio_tls_openssl.c +0 -1106
  99. data/ext/iodine/fio_tmpfile.h +0 -50
  100. data/ext/iodine/fiobj.h +0 -44
  101. data/ext/iodine/fiobj4fio.h +0 -21
  102. data/ext/iodine/fiobj_ary.c +0 -333
  103. data/ext/iodine/fiobj_ary.h +0 -139
  104. data/ext/iodine/fiobj_data.c +0 -1187
  105. data/ext/iodine/fiobj_data.h +0 -167
  106. data/ext/iodine/fiobj_hash.c +0 -409
  107. data/ext/iodine/fiobj_hash.h +0 -176
  108. data/ext/iodine/fiobj_json.c +0 -622
  109. data/ext/iodine/fiobj_json.h +0 -68
  110. data/ext/iodine/fiobj_mem.h +0 -71
  111. data/ext/iodine/fiobj_mustache.c +0 -317
  112. data/ext/iodine/fiobj_mustache.h +0 -62
  113. data/ext/iodine/fiobj_numbers.c +0 -344
  114. data/ext/iodine/fiobj_numbers.h +0 -127
  115. data/ext/iodine/fiobj_str.c +0 -433
  116. data/ext/iodine/fiobj_str.h +0 -172
  117. data/ext/iodine/fiobject.c +0 -620
  118. data/ext/iodine/fiobject.h +0 -655
  119. data/ext/iodine/hpack.h +0 -1923
  120. data/ext/iodine/http.c +0 -2743
  121. data/ext/iodine/http.h +0 -1002
  122. data/ext/iodine/http1.c +0 -910
  123. data/ext/iodine/http1.h +0 -29
  124. data/ext/iodine/http1_parser.h +0 -878
  125. data/ext/iodine/http_internal.c +0 -1279
  126. data/ext/iodine/http_internal.h +0 -237
  127. data/ext/iodine/http_mime_parser.h +0 -350
  128. data/ext/iodine/iodine_caller.c +0 -230
  129. data/ext/iodine/iodine_connection.c +0 -941
  130. data/ext/iodine/iodine_defer.c +0 -420
  131. data/ext/iodine/iodine_fiobj2rb.h +0 -120
  132. data/ext/iodine/iodine_helpers.c +0 -282
  133. data/ext/iodine/iodine_helpers.h +0 -12
  134. data/ext/iodine/iodine_http.c +0 -1181
  135. data/ext/iodine/iodine_http.h +0 -23
  136. data/ext/iodine/iodine_json.c +0 -302
  137. data/ext/iodine/iodine_mustache.c +0 -567
  138. data/ext/iodine/iodine_pubsub.c +0 -580
  139. data/ext/iodine/iodine_pubsub.h +0 -26
  140. data/ext/iodine/iodine_rack_io.c +0 -273
  141. data/ext/iodine/iodine_rack_io.h +0 -20
  142. data/ext/iodine/iodine_store.c +0 -146
  143. data/ext/iodine/iodine_tcp.c +0 -346
  144. data/ext/iodine/iodine_tcp.h +0 -13
  145. data/ext/iodine/iodine_tls.c +0 -261
  146. data/ext/iodine/mustache_parser.h +0 -1546
  147. data/ext/iodine/redis_engine.c +0 -957
  148. data/ext/iodine/redis_engine.h +0 -79
  149. data/ext/iodine/resp_parser.h +0 -317
  150. data/ext/iodine/websocket_parser.h +0 -506
  151. data/ext/iodine/websockets.c +0 -743
  152. data/ext/iodine/websockets.h +0 -185
  153. data/lib/iodine/connection.rb +0 -61
  154. data/lib/iodine/json.rb +0 -42
  155. data/lib/iodine/mustache.rb +0 -113
  156. data/lib/iodine/pubsub.rb +0 -55
  157. data/lib/iodine/rack_utils.rb +0 -43
  158. data/lib/iodine/tls.rb +0 -16
  159. data/lib/rack/handler/iodine.rb +0 -33
  160. data/logo.png +0 -0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iodine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.59
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev
@@ -10,270 +10,144 @@ cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
- name: rake
13
+ name: rake-compiler
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '12.0'
18
+ version: '1'
19
19
  - - "<"
20
20
  - !ruby/object:Gem::Version
21
- version: '14.0'
21
+ version: '2.0'
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: '12.0'
28
+ version: '1'
29
29
  - - "<"
30
30
  - !ruby/object:Gem::Version
31
- version: '14.0'
31
+ version: '2.0'
32
32
  - !ruby/object:Gem::Dependency
33
- name: minitest
33
+ name: rake
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - ">="
37
- - !ruby/object:Gem::Version
38
- version: '5'
39
- - - "<"
36
+ - - "~>"
40
37
  - !ruby/object:Gem::Version
41
- version: '6.0'
38
+ version: '13.0'
42
39
  type: :development
43
40
  prerelease: false
44
41
  version_requirements: !ruby/object:Gem::Requirement
45
42
  requirements:
46
- - - ">="
43
+ - - "~>"
47
44
  - !ruby/object:Gem::Version
48
- version: '5'
49
- - - "<"
50
- - !ruby/object:Gem::Version
51
- version: '6.0'
45
+ version: '13.0'
52
46
  - !ruby/object:Gem::Dependency
53
47
  name: rspec
54
48
  requirement: !ruby/object:Gem::Requirement
55
49
  requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- version: 3.9.0
59
- - - "<"
60
- - !ruby/object:Gem::Version
61
- version: '4.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: 3.9.0
69
- - - "<"
70
- - !ruby/object:Gem::Version
71
- version: '4.0'
72
- - !ruby/object:Gem::Dependency
73
- name: spec
74
- requirement: !ruby/object:Gem::Requirement
75
- requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- version: 5.3.0
79
- - - "<"
50
+ - - "~>"
80
51
  - !ruby/object:Gem::Version
81
- version: '6.0'
52
+ version: '3.0'
82
53
  type: :development
83
54
  prerelease: false
84
55
  version_requirements: !ruby/object:Gem::Requirement
85
56
  requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: 5.3.0
89
- - - "<"
90
- - !ruby/object:Gem::Version
91
- version: '6.0'
92
- - !ruby/object:Gem::Dependency
93
- name: rake-compiler
94
- requirement: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - ">="
57
+ - - "~>"
97
58
  - !ruby/object:Gem::Version
98
- version: '1'
99
- - - "<"
100
- - !ruby/object:Gem::Version
101
- version: '2.0'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: '1'
109
- - - "<"
110
- - !ruby/object:Gem::Version
111
- version: '2.0'
59
+ version: '3.0'
112
60
  description: A fast HTTP / Websocket Server with built-in Pub/Sub support (with or
113
- without Redis), static file support and many other features, optimized for Ruby
114
- MRI on Linux / BSD / macOS / Windows
61
+ without a RESP3 database such as Valkey or Redis), static file support and many
62
+ other features, optimized for Ruby MRI on Linux / BSD / macOS / Windows
115
63
  email:
116
- - bo@plezi.io
64
+ - bo@bowild.com
117
65
  executables:
118
66
  - iodine
119
67
  extensions:
120
68
  - ext/iodine/extconf.rb
121
69
  extra_rdoc_files: []
122
70
  files:
123
- - ".github/ISSUE_TEMPLATE/bug_report.md"
124
- - ".github/workflows/ruby.yml"
125
- - ".gitignore"
71
+ - ".clang-format"
126
72
  - ".rspec"
127
73
  - ".yardopts"
128
74
  - CHANGELOG.md
129
75
  - Gemfile
130
76
  - LICENSE.txt
131
- - LIMITS.md
132
77
  - README.md
133
78
  - Rakefile
134
79
  - SECURITY.md
135
- - SPEC-PubSub-Draft.md
136
- - SPEC-WebSocket-Draft.md
137
- - bin/console
138
- - bin/info.md
139
- - bin/mustache_bench.rb
140
- - bin/poc/Gemfile.lock
141
- - bin/poc/README.md
142
- - bin/poc/config.ru
143
- - bin/poc/gemfile
144
- - bin/poc/www/index.html
145
- - examples/async_task.ru
146
- - examples/bates/README.md
147
- - examples/bates/config.ru
148
- - examples/bates/david+bold.pdf
149
- - examples/bates/public/drop-pdf.png
150
- - examples/bates/public/index.html
80
+ - examples/chatroom.nru
81
+ - examples/client
82
+ - examples/config-hello.nru
83
+ - examples/config-hello.ru
84
+ - examples/config-hijack.ru
85
+ - examples/config-shootout.ru
86
+ - examples/config.nru
87
+ - examples/config.rb
151
88
  - examples/config.ru
152
- - examples/echo.ru
153
- - examples/etag.ru
154
- - examples/hello.ru
155
- - examples/pubsub_engine.ru
156
- - examples/rack3.ru
157
- - examples/redis.ru
158
- - examples/shootout.ru
159
- - examples/sub-protocols.ru
160
- - examples/tcp_client.rb
161
- - examples/x-sendfile.ru
89
+ - examples/fake
90
+ - examples/hello_neorack
91
+ - examples/routes.nru
92
+ - examples/routes.ru
162
93
  - exe/iodine
163
94
  - ext/iodine/extconf.rb
164
- - ext/iodine/fio.c
165
- - ext/iodine/fio.h
166
- - ext/iodine/fio_cli.c
167
- - ext/iodine/fio_cli.h
168
- - ext/iodine/fio_json_parser.h
169
- - ext/iodine/fio_siphash.c
170
- - ext/iodine/fio_siphash.h
171
- - ext/iodine/fio_tls.h
172
- - ext/iodine/fio_tls_missing.c
173
- - ext/iodine/fio_tls_openssl.c
174
- - ext/iodine/fio_tmpfile.h
175
- - ext/iodine/fiobj.h
176
- - ext/iodine/fiobj4fio.h
177
- - ext/iodine/fiobj_ary.c
178
- - ext/iodine/fiobj_ary.h
179
- - ext/iodine/fiobj_data.c
180
- - ext/iodine/fiobj_data.h
181
- - ext/iodine/fiobj_hash.c
182
- - ext/iodine/fiobj_hash.h
183
- - ext/iodine/fiobj_json.c
184
- - ext/iodine/fiobj_json.h
185
- - ext/iodine/fiobj_mem.h
186
- - ext/iodine/fiobj_mustache.c
187
- - ext/iodine/fiobj_mustache.h
188
- - ext/iodine/fiobj_numbers.c
189
- - ext/iodine/fiobj_numbers.h
190
- - ext/iodine/fiobj_str.c
191
- - ext/iodine/fiobj_str.h
192
- - ext/iodine/fiobject.c
193
- - ext/iodine/fiobject.h
194
- - ext/iodine/hpack.h
195
- - ext/iodine/http.c
196
- - ext/iodine/http.h
197
- - ext/iodine/http1.c
198
- - ext/iodine/http1.h
199
- - ext/iodine/http1_parser.h
200
- - ext/iodine/http_internal.c
201
- - ext/iodine/http_internal.h
202
- - ext/iodine/http_mime_parser.h
95
+ - ext/iodine/fio-stl.h
96
+ - ext/iodine/fio-stl.md
203
97
  - ext/iodine/iodine.c
204
98
  - ext/iodine/iodine.h
205
- - ext/iodine/iodine_caller.c
99
+ - ext/iodine/iodine_arg_helper.h
206
100
  - ext/iodine/iodine_caller.h
207
- - ext/iodine/iodine_connection.c
101
+ - ext/iodine/iodine_cli.h
102
+ - ext/iodine/iodine_compression.h
208
103
  - ext/iodine/iodine_connection.h
209
- - ext/iodine/iodine_defer.c
104
+ - ext/iodine/iodine_core.h
105
+ - ext/iodine/iodine_crypto.h
210
106
  - ext/iodine/iodine_defer.h
211
- - ext/iodine/iodine_fiobj2rb.h
212
- - ext/iodine/iodine_helpers.c
213
- - ext/iodine/iodine_helpers.h
214
- - ext/iodine/iodine_http.c
215
- - ext/iodine/iodine_http.h
216
- - ext/iodine/iodine_json.c
217
107
  - ext/iodine/iodine_json.h
218
- - ext/iodine/iodine_mustache.c
108
+ - ext/iodine/iodine_listener.h
109
+ - ext/iodine/iodine_log.h
110
+ - ext/iodine/iodine_minimap.h
219
111
  - ext/iodine/iodine_mustache.h
220
- - ext/iodine/iodine_pubsub.c
221
- - ext/iodine/iodine_pubsub.h
222
- - ext/iodine/iodine_rack_io.c
223
- - ext/iodine/iodine_rack_io.h
224
- - ext/iodine/iodine_store.c
112
+ - ext/iodine/iodine_pubsub_eng.h
113
+ - ext/iodine/iodine_pubsub_history.h
114
+ - ext/iodine/iodine_pubsub_msg.h
115
+ - ext/iodine/iodine_redis.h
225
116
  - ext/iodine/iodine_store.h
226
- - ext/iodine/iodine_tcp.c
227
- - ext/iodine/iodine_tcp.h
228
- - ext/iodine/iodine_tls.c
117
+ - ext/iodine/iodine_threads.h
229
118
  - ext/iodine/iodine_tls.h
230
- - ext/iodine/mustache_parser.h
231
- - ext/iodine/redis_engine.c
232
- - ext/iodine/redis_engine.h
233
- - ext/iodine/resp_parser.h
234
- - ext/iodine/websocket_parser.h
235
- - ext/iodine/websockets.c
236
- - ext/iodine/websockets.h
119
+ - ext/iodine/iodine_utils.h
237
120
  - iodine.gemspec
238
121
  - lib/iodine.rb
239
- - lib/iodine/connection.rb
240
- - lib/iodine/json.rb
241
- - lib/iodine/mustache.rb
242
- - lib/iodine/pubsub.rb
243
- - lib/iodine/rack_utils.rb
244
- - lib/iodine/tls.rb
122
+ - lib/iodine/benchmark.rb
123
+ - lib/iodine/documentation.rb
245
124
  - lib/iodine/version.rb
246
- - lib/rack/handler/iodine.rb
247
- - logo.png
125
+ - logo.svg
126
+ - mustache.md
127
+ - sig/iodine.rbs
248
128
  homepage: https://github.com/boazsegev/iodine
249
129
  licenses:
250
130
  - MIT
251
131
  metadata:
252
132
  allowed_push_host: https://rubygems.org
253
- post_install_message: |-
254
- Thank you for installing Iodine 0.7.59.
255
- Remember: if iodine supports your business, it's only fair to give value back (code contributions / donations).
133
+ homepage_uri: https://github.com/boazsegev/iodine
134
+ source_code_uri: https://github.com/boazsegev/iodine
135
+ changelog_uri: https://github.com/boazsegev/iodine/blob/master/CHANGELOG.md
136
+ post_install_message: Thank you for installing Iodine 0.8.0.
256
137
  rdoc_options: []
257
138
  require_paths:
258
139
  - lib
259
- - ext
260
140
  required_ruby_version: !ruby/object:Gem::Requirement
261
141
  requirements:
262
142
  - - ">="
263
143
  - !ruby/object:Gem::Version
264
- version: 2.2.2
144
+ version: 3.2.0
265
145
  required_rubygems_version: !ruby/object:Gem::Requirement
266
146
  requirements:
267
147
  - - ">="
268
148
  - !ruby/object:Gem::Version
269
149
  version: '0'
270
- requirements:
271
- - 'A Unix based system: Linux / macOS / BSD.'
272
- - An updated C compiler.
273
- - Ruby >= 2.3.8 (Ruby EOL).
274
- - Ruby >= 2.5.0 recommended.
275
- - TLS requires OpenSSL >= 1.1.0.
276
- - Or Windows with Ruby >= 3.0.0 build with MingW and MingW as compiler.
150
+ requirements: []
277
151
  rubygems_version: 4.0.3
278
152
  specification_version: 4
279
153
  summary: iodine - a fast HTTP / Websocket Server with Pub/Sub support, optimized for
@@ -1,40 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- ### System Information
11
-
12
- - **OS**: [e.g. macOS 10.15.4]
13
- - **Ruby**: [e.g. 2.7.0]
14
- - **Version**: [e.g. 0.7.38]
15
- - **OpenSSL**: [OpenSSL 1.1.1f 20 Mar 2020]
16
-
17
- ### Description
18
-
19
- A clear and concise description of what the bug is.
20
-
21
- ### Rack App to Reproduce
22
-
23
- ```ruby
24
- APP = proc {|env| [200, {}, ["Hello World"]] }
25
- run APP
26
- ```
27
-
28
- ### Testing code
29
-
30
- ```sh
31
- curl http://localhost:3000/
32
- ```
33
-
34
- ### Expected behavior
35
-
36
- A clear and concise description of what you expected to happen.
37
-
38
- ### Actual behavior
39
-
40
- A clear and concise description of what actually happened.
@@ -1,42 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support documentation.
4
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
5
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
6
-
7
- name: Building iodine
8
-
9
- on:
10
- push:
11
- branches: [ "master" ]
12
- pull_request:
13
- branches: [ "master" ]
14
-
15
- permissions:
16
- contents: read
17
-
18
- jobs:
19
- test:
20
- strategy:
21
- fail-fast: false
22
- matrix:
23
- ruby-version: ['2.3', '2.7', '3.0', '3.1', '3.2']
24
- os: [ubuntu-latest, macos-latest] # , windows-latest
25
- runs-on: ${{ matrix.os }}
26
- steps:
27
- - uses: actions/checkout@v3
28
- - name: Set up Ruby # see https://github.com/ruby/setup-ruby#versioning)
29
- uses: ruby/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby-version }}
32
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
- - name: Build and Test Iodine
34
- run: |
35
- echo CFLAGS = $CFLAGS
36
- echo cflags = $cflags
37
- echo HOME = $HOME
38
- ruby -e 'puts Gem.default_dir'
39
- bundle exec rake install
40
- # env VERBOSE=1 bundle exec rspec --format documentation
41
- # - name: Run tests
42
- # run: bundle exec rake
data/.gitignore DELETED
@@ -1,20 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- /old_stuff/
11
- *.bundle
12
- *.so
13
- *.gem
14
-
15
- .ruby-version
16
- .clang_complete
17
-
18
- .DS_Store
19
- spec/examples.txt
20
- spec/log
data/LIMITS.md DELETED
@@ -1,41 +0,0 @@
1
- # Iodine limits and settings
2
-
3
- I will, at some point, document these... here's the key points:
4
-
5
- ## SSL/TLS
6
-
7
- * TLS support requires OpenSSL 1.1.0 and above. On Heroku, this requires `heroku-18`.
8
-
9
- * Iodine supports TLS 1.2 and above (depending on the OpenSSL version used).
10
-
11
- ## HTTP limits
12
-
13
- * Uploads are adjustable and limited to ~50Mib by default.
14
-
15
- * HTTP connection timeout (keep-alive) is adjustable and set to ~60 seconds by default.
16
-
17
- * HTTP total header size is adjustable and limited to ~32Kib by default.
18
-
19
- * HTTP header line length size is limited to a hard-coded limit of 8Kb.
20
-
21
- * HTTP headers count is limited to a hard-coded limit of 128 headers.
22
-
23
- ## Websocket
24
-
25
- * Incoming Websocket message size limits are adjustable and limited to ~250Kib by default.
26
-
27
- ## EventSource / SSE
28
-
29
- * Iodine will automatically attempt to send a `ping` event instead of disconnecting the connection. The ping interval is the same as the HTTP connection timeout interval.
30
-
31
- ## Pub/Sub
32
-
33
- * Channel names are binary safe and unlimited in length. However, name lengths effect performance.
34
-
35
- **Do NOT allow clients to dictate the channel name**, as they might use extremely long names and cause resource starvation.
36
-
37
- * Pub/sub is limited to the process cluster. To use pub/sub with an external service (such as Redis) an "Engine" is required (see YARD documentation).
38
-
39
- * Pub/sub pattern matching supports only the Redis pattern matching approach. This makes patterns significantly more expensive and exact matches simpler and faster.
40
-
41
- It's recommended to prefer exact channel/stream name matching when possible.
data/SPEC-PubSub-Draft.md DELETED
@@ -1,159 +0,0 @@
1
- # Ruby pub/sub API Specification Draft
2
-
3
- ### Draft State
4
-
5
- This draft is under discussion and will be implemented by iodine starting with the 0.8.x versions.
6
-
7
- ---
8
-
9
- ## Purpose
10
-
11
- This document details a Rack specification extension for publish/subscribe (pub/sub) modules that can extend WebSocket / EventSource Rack servers.
12
-
13
- The purpose of this specification is:
14
-
15
- 1. To keep separation of concerns by avoiding inter-process-communication logic (IPC) in the application code base.
16
-
17
- This is important since IPC is often implemented using pipes / sockets, which could introduce network and IO concerns into the application code.
18
-
19
- 2. To specify a common publish/subscribe (pub/sub) API for servers and pub/sub modules, allowing applications to easily switch between conforming implementations and servers.
20
-
21
- Since pub/sub design is idiomatic to WebSocket and EventSource approaches, as well as other reactive programming techniques, it is better if applications aren't locked in to a specific server / implementation.
22
-
23
- 3. To provide common considerations and guidelines for pub/sub implementors to consider when implementing their pub/sub modules.
24
-
25
- Some concerns are common for pub/sub implementors, such as integrating third party message brokers (Redis, RabbitMQ, Cassandra)
26
-
27
- ## Pub/Sub Instance Methods
28
-
29
- Conforming pub/sub implementations **MUST** implement the following pub/sub instance methods:
30
-
31
- * `pubsub?` **MUST** return the pub/sub API version as an integer number. Currently, set to `0` (development version).
32
-
33
- * `subscribe(to, is_pattern = false) { |from, message| optional_block }` where:
34
-
35
- * `to` is a named **channel** (or **pattern**).
36
-
37
- The implementation **MAY** support pattern matching for named channels (`to`). The pattern matching algorithm used, if any, **SHOULD** be documented.
38
-
39
- If the implementation does **NOT** support pattern matching and `is_pattern` is truthful, the implementation **MUST** raise and exception.
40
-
41
- `to` **SHOULD** be a String, but implementations **MAY** support Symbols as aliases to Strings (in which case `:my_channel` is the same `'my_channel'`).
42
-
43
- * `block` is optional and accepts (if provided) two arguments (`from` which is equal to `to` and `message` which contains the data's content).
44
-
45
- `block` (if provided) **MUST** be called when a publication was received by the named channel.
46
-
47
- If no `block` is provided:
48
-
49
- * If the pub/sub instance is an extended WebSocket / EventSource (SSE) `client` object (see the WebSocket / EventSource extension draft) data should be directly sent to the `client`.
50
-
51
- * If the pub/sub isn't linked with a `client` / connection, an exception **MUST** be raised.
52
-
53
- If a subscription to `to` already exists for the same pub/sub instance, it should be *replaced* by the new subscription (the old subscription should be canceled / unsubscribed).
54
-
55
- If the pub/sub instance is an extended WebSocket / EventSource (SSE) `client` object (see the WebSocket / EventSource extension draft), the subscription **MUST** be closed automatically when the connection is closed (when `on_close` is called).
56
-
57
- Otherwise, the subscription **MUST** be closed automatically when the pub/sub object goes out of scope and is garbage collected (if this ever happens).
58
-
59
- The `subscribe` method **MUST** return `nil` on a known failure (i.e., when the connection is already closed), or any truthful value on success.
60
-
61
- * `unsubscribe(from, is_pattern = false)` should cancel a subscription to the `from` named channel / pattern.
62
-
63
- * `publish(to, message, engine = nil)` where:
64
-
65
- * `to` is a named channel, same as detailed in `subscribe`.
66
-
67
- Implementations **MAY** support pattern based publishing. This **SHOULD** be documented as well as how patterns are detected (as opposed to named channels). Note that pattern publishing isn't supported by common backends (such as Redis) and introduces complex privacy and security concerns.
68
-
69
- * `message` a String containing the data to be published.
70
-
71
- If `message` is NOT a String, the implementation **MAY** convert the data silently to JSON. Otherwise, the implementation **MUST** raise an exception.
72
-
73
- `message` encoding (binary / UTZ-8) **MAY** be altered during publication, but any change **MUST** result in valid encoding.
74
-
75
- * `engine` routes the publish method to the specified pub/sub Engine (see later on). If none is specified, the default engine should be used. If `false` is specified, the message **MUST** be forwarded to all subscribed clients on the **same process**.
76
-
77
- The `publish` method **MUST** return `true` if a publication was scheduled (not necessarily performed). If it's already known that the publication would fail, the method should return `false`.
78
-
79
- An implementation **MUST** call the relevant PubSubEngine's `publish` method after performing any internal book keeping logic. If `engine` is `nil`, the default PubSubEngine should be called. If `engine` is `false`, the implementation **MUST** forward the published message to the actual clients (if any).
80
-
81
- A global alias for this method (allowing it to be accessed from outside active connections) **MAY** be defined as `Rack::PubSub.publish`.
82
-
83
- ## Integrating a Pub/Sub module into a WebSocket / EventSource (SSE) `client` object
84
-
85
- A conforming pub/sub module **MUST** be designed so that it can be integrated into WebSocket / EventSource (SSE) `client` objects be `include`-ing their class.
86
-
87
- This **MUST** result in a behavior where subscriptions are destroyed / canceled once the `client` object state changes to "closed" - i.e., either when the `on_close` callback is called, or the first time the method `client.open?` returns `false`.
88
-
89
- The idiomatic way to add a pub/sub module to a `client`'s class is:
90
-
91
- ```ruby
92
- client.class.prepend MyPubSubModule unless client.pubsub?
93
- ```
94
-
95
- The pub/sub module **MUST** expect and support this behavior.
96
-
97
- **Note**: the use of `prepend` (rather than `include`) is chosen so that it's possible to override the `client`'s instance method of `pubsub?`.
98
-
99
- ## Connecting to External Backends (pub/sub Engines)
100
-
101
- It is common for scaling applications to require an external message broker backend such as Redis, RabbitMQ, etc'. The following requirements set a common interface for such "engine" implementation and integration.
102
-
103
- Pub/sub implementations **MUST** implement the following module / class methods in one of their public classes / modules (iodine implements these under `Iodine::PubSub`):
104
-
105
- * `attach(engine)` where `engine` is a `PubSubEngine` object, as described in this specification.
106
-
107
- When a pub/sub engine is attached, the implementation **MUST** inform the engine of any existing or future subscriptions.
108
-
109
- The implementation **MUST** call the engine's `subscribe` callback for each existing (and future) subscription.
110
-
111
- The implementation **MUST** allow multiple "engines" to be attached when multiple calls to `attach` are made.
112
-
113
- * `detach(engine)` where `engine` is a PubSubEngine object as described in this specification.
114
-
115
- The implementation **MUST** remove the engine from the attached engine list. The opposite of `attach`.
116
-
117
- * `default=(engine)` sets a default pub/sub engine, where `engine` is a PubSubEngine object as described in this specification.
118
-
119
- Implementations **MUST** forward any `publish` method calls to the default pub/sub engine, unless an `engine` is specified in arguments passes to the `publish` method.
120
-
121
- * `default` returns the current default pub/sub engine, where the engine is a PubSubEngine object as described in this specification.
122
-
123
- * `reset(engine)` where `engine` is a PubSubEngine object as described in this specification.
124
-
125
- Implementations **MUST** behave as if the engine was newly registered and (re)inform the engine of any existing subscriptions by calling engine's `subscribe` callback for each existing subscription.
126
-
127
- A `PubSubEngine` instance object **MUST** implement the following methods:
128
-
129
- * `subscribe(to, is_pattern = false)` this method informs the engine that a subscription to the specified channel / pattern exists for the calling the process. It **MUST ONLY** be called **once** for all existing and future subscriptions to that channel within the process.
130
-
131
- The method **MUST** return `true` if a subscription was scheduled (or performed) or `false` if the subscription is known to fail.
132
-
133
- This method will be called by the pub/sub implementation (for each registered engine). The engine **MAY** assume that the method would never be called directly by an application / client.
134
-
135
- This method **MUST NOT** raise an exception.
136
-
137
- * `unsubscribe(from, is_pattern = false)` this method informs an engine that there are no more subscriptions to the named channel / pattern for the calling process.
138
-
139
- The method's semantics are similar to `subscribe` only is performs the opposite action.
140
-
141
- This method **MUST NOT** raise an exception.
142
-
143
- This method will be called by the pub/sub implementation (for each registered engine). The engine **MAY** assume that the method would never be called directly by an application / client.
144
-
145
- * `publish(channel, message)` where both `channel` is either a Symbol or a String (both being equivalent) and `message` **MUST** be a String.
146
-
147
- This method will be called by the server when a message is published using the engine.
148
-
149
- This method will be called by the pub/sub implementation (for each registered engine).
150
-
151
- The engine **MUST** assume that the method **MAY** be called directly by an application / client.
152
-
153
- In order for a PubSubEngine instance object to publish messages to all subscribed clients on a particular process, it **SHOULD** call the implementation's global `publish` method with the engine set to `false`.
154
-
155
- i.e., if the implementation's global `publish` method is in a class called `Iodine`:
156
-
157
- ```ruby
158
- Iodine.publish channel, message, false
159
- ```