polyphony 0.43.8

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 (221) hide show
  1. checksums.yaml +7 -0
  2. data/.gitbook.yaml +4 -0
  3. data/.github/workflows/test.yml +29 -0
  4. data/.gitignore +59 -0
  5. data/.rubocop.yml +175 -0
  6. data/CHANGELOG.md +393 -0
  7. data/Gemfile +3 -0
  8. data/Gemfile.lock +141 -0
  9. data/LICENSE +21 -0
  10. data/README.md +51 -0
  11. data/Rakefile +26 -0
  12. data/TODO.md +201 -0
  13. data/bin/polyphony-debug +87 -0
  14. data/docs/_config.yml +64 -0
  15. data/docs/_includes/head.html +40 -0
  16. data/docs/_includes/title.html +1 -0
  17. data/docs/_sass/custom/custom.scss +10 -0
  18. data/docs/_sass/overrides.scss +0 -0
  19. data/docs/_user-guide/all-about-timers.md +126 -0
  20. data/docs/_user-guide/index.md +9 -0
  21. data/docs/_user-guide/web-server.md +136 -0
  22. data/docs/api-reference/exception.md +27 -0
  23. data/docs/api-reference/fiber.md +425 -0
  24. data/docs/api-reference/index.md +9 -0
  25. data/docs/api-reference/io.md +36 -0
  26. data/docs/api-reference/object.md +99 -0
  27. data/docs/api-reference/polyphony-baseexception.md +33 -0
  28. data/docs/api-reference/polyphony-cancel.md +26 -0
  29. data/docs/api-reference/polyphony-moveon.md +24 -0
  30. data/docs/api-reference/polyphony-net.md +20 -0
  31. data/docs/api-reference/polyphony-process.md +28 -0
  32. data/docs/api-reference/polyphony-resourcepool.md +59 -0
  33. data/docs/api-reference/polyphony-restart.md +18 -0
  34. data/docs/api-reference/polyphony-terminate.md +18 -0
  35. data/docs/api-reference/polyphony-threadpool.md +67 -0
  36. data/docs/api-reference/polyphony-throttler.md +77 -0
  37. data/docs/api-reference/polyphony.md +36 -0
  38. data/docs/api-reference/thread.md +88 -0
  39. data/docs/assets/img/echo-fibers.svg +1 -0
  40. data/docs/assets/img/sleeping-fiber.svg +1 -0
  41. data/docs/faq.md +195 -0
  42. data/docs/favicon.ico +0 -0
  43. data/docs/getting-started/index.md +10 -0
  44. data/docs/getting-started/installing.md +34 -0
  45. data/docs/getting-started/overview.md +486 -0
  46. data/docs/getting-started/tutorial.md +359 -0
  47. data/docs/index.md +94 -0
  48. data/docs/main-concepts/concurrency.md +151 -0
  49. data/docs/main-concepts/design-principles.md +161 -0
  50. data/docs/main-concepts/exception-handling.md +291 -0
  51. data/docs/main-concepts/extending.md +89 -0
  52. data/docs/main-concepts/fiber-scheduling.md +197 -0
  53. data/docs/main-concepts/index.md +9 -0
  54. data/docs/polyphony-logo.png +0 -0
  55. data/examples/adapters/concurrent-ruby.rb +9 -0
  56. data/examples/adapters/pg_client.rb +36 -0
  57. data/examples/adapters/pg_notify.rb +35 -0
  58. data/examples/adapters/pg_pool.rb +43 -0
  59. data/examples/adapters/pg_transaction.rb +31 -0
  60. data/examples/adapters/redis_blpop.rb +12 -0
  61. data/examples/adapters/redis_channels.rb +122 -0
  62. data/examples/adapters/redis_client.rb +19 -0
  63. data/examples/adapters/redis_pubsub.rb +26 -0
  64. data/examples/adapters/redis_pubsub_perf.rb +68 -0
  65. data/examples/core/01-spinning-up-fibers.rb +18 -0
  66. data/examples/core/02-awaiting-fibers.rb +20 -0
  67. data/examples/core/03-interrupting.rb +39 -0
  68. data/examples/core/04-handling-signals.rb +19 -0
  69. data/examples/core/xx-agent.rb +102 -0
  70. data/examples/core/xx-at_exit.rb +29 -0
  71. data/examples/core/xx-caller.rb +12 -0
  72. data/examples/core/xx-channels.rb +45 -0
  73. data/examples/core/xx-daemon.rb +14 -0
  74. data/examples/core/xx-deadlock.rb +8 -0
  75. data/examples/core/xx-deferring-an-operation.rb +14 -0
  76. data/examples/core/xx-erlang-style-genserver.rb +81 -0
  77. data/examples/core/xx-exception-backtrace.rb +40 -0
  78. data/examples/core/xx-fork-cleanup.rb +22 -0
  79. data/examples/core/xx-fork-spin.rb +42 -0
  80. data/examples/core/xx-fork-terminate.rb +27 -0
  81. data/examples/core/xx-forking.rb +24 -0
  82. data/examples/core/xx-move_on.rb +23 -0
  83. data/examples/core/xx-pingpong.rb +18 -0
  84. data/examples/core/xx-queue-async.rb +120 -0
  85. data/examples/core/xx-readpartial.rb +18 -0
  86. data/examples/core/xx-recurrent-timer.rb +12 -0
  87. data/examples/core/xx-resource_delegate.rb +31 -0
  88. data/examples/core/xx-signals.rb +16 -0
  89. data/examples/core/xx-sleep-forever.rb +9 -0
  90. data/examples/core/xx-sleeping.rb +25 -0
  91. data/examples/core/xx-snooze-starve.rb +16 -0
  92. data/examples/core/xx-spin-fork.rb +49 -0
  93. data/examples/core/xx-spin_error_backtrace.rb +33 -0
  94. data/examples/core/xx-state-machine.rb +51 -0
  95. data/examples/core/xx-stop.rb +20 -0
  96. data/examples/core/xx-supervise-process.rb +30 -0
  97. data/examples/core/xx-supervisors.rb +21 -0
  98. data/examples/core/xx-thread-selector-sleep.rb +51 -0
  99. data/examples/core/xx-thread-selector-snooze.rb +46 -0
  100. data/examples/core/xx-thread-sleep.rb +17 -0
  101. data/examples/core/xx-thread-snooze.rb +34 -0
  102. data/examples/core/xx-thread_pool.rb +17 -0
  103. data/examples/core/xx-throttling.rb +18 -0
  104. data/examples/core/xx-timeout.rb +10 -0
  105. data/examples/core/xx-timer-gc.rb +17 -0
  106. data/examples/core/xx-trace.rb +79 -0
  107. data/examples/core/xx-using-a-mutex.rb +21 -0
  108. data/examples/core/xx-worker-thread.rb +30 -0
  109. data/examples/io/tunnel.rb +48 -0
  110. data/examples/io/xx-backticks.rb +11 -0
  111. data/examples/io/xx-echo_client.rb +25 -0
  112. data/examples/io/xx-echo_client_from_stdin.rb +21 -0
  113. data/examples/io/xx-echo_pipe.rb +16 -0
  114. data/examples/io/xx-echo_server.rb +17 -0
  115. data/examples/io/xx-echo_server_with_timeout.rb +34 -0
  116. data/examples/io/xx-echo_stdin.rb +14 -0
  117. data/examples/io/xx-happy-eyeballs.rb +36 -0
  118. data/examples/io/xx-httparty.rb +38 -0
  119. data/examples/io/xx-irb.rb +17 -0
  120. data/examples/io/xx-net-http.rb +15 -0
  121. data/examples/io/xx-open.rb +16 -0
  122. data/examples/io/xx-switch.rb +15 -0
  123. data/examples/io/xx-system.rb +11 -0
  124. data/examples/io/xx-tcpserver.rb +15 -0
  125. data/examples/io/xx-tcpsocket.rb +18 -0
  126. data/examples/io/xx-zip.rb +19 -0
  127. data/examples/performance/fiber_transfer.rb +47 -0
  128. data/examples/performance/fs_read.rb +38 -0
  129. data/examples/performance/mem-usage.rb +56 -0
  130. data/examples/performance/messaging.rb +29 -0
  131. data/examples/performance/multi_snooze.rb +33 -0
  132. data/examples/performance/snooze.rb +39 -0
  133. data/examples/performance/snooze_raw.rb +39 -0
  134. data/examples/performance/thread-vs-fiber/polyphony_mt_server.rb +74 -0
  135. data/examples/performance/thread-vs-fiber/polyphony_server.rb +45 -0
  136. data/examples/performance/thread-vs-fiber/polyphony_server_read_loop.rb +58 -0
  137. data/examples/performance/thread-vs-fiber/threaded_server.rb +27 -0
  138. data/examples/performance/thread-vs-fiber/xx-httparty_multi.rb +36 -0
  139. data/examples/performance/thread-vs-fiber/xx-httparty_threaded.rb +29 -0
  140. data/examples/performance/thread_pool_perf.rb +63 -0
  141. data/examples/performance/xx-array.rb +11 -0
  142. data/examples/performance/xx-fiber-switch.rb +9 -0
  143. data/examples/performance/xx-snooze.rb +15 -0
  144. data/examples/xx-spin.rb +32 -0
  145. data/ext/libev/Changes +548 -0
  146. data/ext/libev/LICENSE +37 -0
  147. data/ext/libev/README +59 -0
  148. data/ext/libev/README.embed +3 -0
  149. data/ext/libev/ev.c +5279 -0
  150. data/ext/libev/ev.h +856 -0
  151. data/ext/libev/ev_epoll.c +296 -0
  152. data/ext/libev/ev_kqueue.c +224 -0
  153. data/ext/libev/ev_linuxaio.c +642 -0
  154. data/ext/libev/ev_poll.c +156 -0
  155. data/ext/libev/ev_port.c +192 -0
  156. data/ext/libev/ev_select.c +316 -0
  157. data/ext/libev/ev_vars.h +215 -0
  158. data/ext/libev/ev_win32.c +162 -0
  159. data/ext/libev/ev_wrap.h +216 -0
  160. data/ext/libev/test_libev_win32.c +123 -0
  161. data/ext/polyphony/extconf.rb +20 -0
  162. data/ext/polyphony/fiber.c +109 -0
  163. data/ext/polyphony/libev.c +2 -0
  164. data/ext/polyphony/libev.h +9 -0
  165. data/ext/polyphony/libev_agent.c +882 -0
  166. data/ext/polyphony/polyphony.c +71 -0
  167. data/ext/polyphony/polyphony.h +97 -0
  168. data/ext/polyphony/polyphony_ext.c +21 -0
  169. data/ext/polyphony/queue.c +168 -0
  170. data/ext/polyphony/ring_buffer.c +96 -0
  171. data/ext/polyphony/ring_buffer.h +28 -0
  172. data/ext/polyphony/thread.c +208 -0
  173. data/ext/polyphony/tracing.c +11 -0
  174. data/lib/polyphony.rb +136 -0
  175. data/lib/polyphony/adapters/fs.rb +19 -0
  176. data/lib/polyphony/adapters/irb.rb +52 -0
  177. data/lib/polyphony/adapters/postgres.rb +110 -0
  178. data/lib/polyphony/adapters/process.rb +33 -0
  179. data/lib/polyphony/adapters/redis.rb +67 -0
  180. data/lib/polyphony/adapters/trace.rb +138 -0
  181. data/lib/polyphony/core/channel.rb +46 -0
  182. data/lib/polyphony/core/exceptions.rb +36 -0
  183. data/lib/polyphony/core/global_api.rb +124 -0
  184. data/lib/polyphony/core/resource_pool.rb +117 -0
  185. data/lib/polyphony/core/sync.rb +21 -0
  186. data/lib/polyphony/core/thread_pool.rb +64 -0
  187. data/lib/polyphony/core/throttler.rb +41 -0
  188. data/lib/polyphony/event.rb +17 -0
  189. data/lib/polyphony/extensions/core.rb +174 -0
  190. data/lib/polyphony/extensions/fiber.rb +379 -0
  191. data/lib/polyphony/extensions/io.rb +221 -0
  192. data/lib/polyphony/extensions/openssl.rb +81 -0
  193. data/lib/polyphony/extensions/socket.rb +150 -0
  194. data/lib/polyphony/extensions/thread.rb +108 -0
  195. data/lib/polyphony/net.rb +77 -0
  196. data/lib/polyphony/version.rb +5 -0
  197. data/polyphony.gemspec +40 -0
  198. data/test/coverage.rb +54 -0
  199. data/test/eg.rb +27 -0
  200. data/test/helper.rb +56 -0
  201. data/test/q.rb +24 -0
  202. data/test/run.rb +5 -0
  203. data/test/stress.rb +25 -0
  204. data/test/test_agent.rb +130 -0
  205. data/test/test_event.rb +59 -0
  206. data/test/test_ext.rb +196 -0
  207. data/test/test_fiber.rb +988 -0
  208. data/test/test_global_api.rb +352 -0
  209. data/test/test_io.rb +249 -0
  210. data/test/test_kernel.rb +57 -0
  211. data/test/test_process_supervision.rb +46 -0
  212. data/test/test_queue.rb +112 -0
  213. data/test/test_resource_pool.rb +138 -0
  214. data/test/test_signal.rb +100 -0
  215. data/test/test_socket.rb +34 -0
  216. data/test/test_supervise.rb +103 -0
  217. data/test/test_thread.rb +170 -0
  218. data/test/test_thread_pool.rb +101 -0
  219. data/test/test_throttler.rb +50 -0
  220. data/test/test_trace.rb +68 -0
  221. metadata +482 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bea457e28d23f96570d448855d00cf76250a55fcb02e12c4305cb551cb55faf4
4
+ data.tar.gz: dc97409e61ce82c20eef25101a2c53046635461ef81302e54b121e5bb9c25aa1
5
+ SHA512:
6
+ metadata.gz: 53d345ee472bc77fc993880a1a725064bb934ec2789fa72bd97ec07b558942369860fb7077e0fcff6c95cfcff0c0d712090f70b1d9ff7f652160d15ddfc77de4
7
+ data.tar.gz: 513a79eeb8a7766078d159cf85d367a6f3f50a0870825275408081d9cfe4e446e7f0b0120bd712f6281ccd0787779ec464b20c9e17c3c60178ceb39c061033c7
@@ -0,0 +1,4 @@
1
+ root: ./docs/
2
+ structure:
3
+ readme: ./README.md
4
+ summary: ./summary.md
@@ -0,0 +1,29 @@
1
+ name: Tests
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ strategy:
8
+ fail-fast: false
9
+ matrix:
10
+ os: [ubuntu-latest]
11
+ ruby: [2.6, 2.7]
12
+
13
+ name: >-
14
+ ${{matrix.os}}, ${{matrix.ruby}}
15
+
16
+ runs-on: ${{matrix.os}}
17
+ steps:
18
+ - uses: actions/checkout@v1
19
+ - uses: actions/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{matrix.ruby}}
22
+ - name: Install dependencies
23
+ run: |
24
+ gem install bundler
25
+ bundle install
26
+ - name: Compile C-extension
27
+ run: bundle exec rake compile
28
+ - name: Run tests
29
+ run: bundle exec rake test
@@ -0,0 +1,59 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
51
+
52
+ test.rb
53
+ .vscode
54
+
55
+ lib/*.bundle
56
+ lib/*.so
57
+
58
+ _site
59
+ .sass-cache
@@ -0,0 +1,175 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+ RubyInterpreters:
4
+ - ruby
5
+ Exclude:
6
+ - '**/*.gemspec'
7
+ - 'test/**/*.rb'
8
+ - 'examples/**/*.rb'
9
+ - 'Gemfile*'
10
+ - lib/polyphony/adapters/irb.rb
11
+
12
+ Style/LambdaCall:
13
+ Enabled: false
14
+ # Style/ModuleFunction:
15
+ # Enabled: false
16
+ # Style/RegexpLiteral:
17
+ # Enabled: false
18
+
19
+ # Naming/MemoizedInstanceVariableName:
20
+ # Enabled: false
21
+
22
+ Style/Alias:
23
+ EnforcedStyle: prefer_alias_method
24
+
25
+ Style/SpecialGlobalVars:
26
+ Enabled: false
27
+
28
+ Style/ClassAndModuleChildren:
29
+ Enabled: false
30
+
31
+ Metrics/AbcSize:
32
+ Enabled: false
33
+
34
+ Style/MixinUsage:
35
+ Enabled: false
36
+
37
+ Style/MultilineBlockChain:
38
+ Enabled: false
39
+
40
+ Lint/RescueException:
41
+ Enabled: false
42
+
43
+ Lint/InheritException:
44
+ Enabled: false
45
+
46
+ Style/NumericPredicate:
47
+ Enabled: false
48
+
49
+ Style/TrivialAccessors:
50
+ Enabled: false
51
+
52
+ Style/MethodMissingSuper:
53
+ Enabled: false
54
+
55
+ Style/GlobalVars:
56
+ Exclude:
57
+ - lib/polyphony/auto_run.rb
58
+ - lib/polyphony/extensions/core.rb
59
+ - examples/**/*.rb
60
+
61
+ Layout/HashAlignment:
62
+ EnforcedColonStyle: table
63
+ EnforcedHashRocketStyle: table
64
+
65
+ Naming/AccessorMethodName:
66
+ Exclude:
67
+ - lib/polyphony/http/server/http1.rb
68
+ - lib/polyphony/http/server/http2_stream.rb
69
+ - examples/**/*.rb
70
+
71
+ Naming/MethodName:
72
+ Exclude:
73
+ - test/test_signal.rb
74
+
75
+ Lint/SuppressedException:
76
+ Exclude:
77
+ - lib/polyphony/http/server/http1.rb
78
+ - lib/polyphony/http/server/http2.rb
79
+ - lib/polyphony/http/server/http2_stream.rb
80
+ - lib/polyphony/http/server.rb
81
+ - examples/**/*.rb
82
+
83
+ Metrics/MethodLength:
84
+ Exclude:
85
+ - lib/polyphony/http/server/rack.rb
86
+ - lib/polyphony/extensions/io.rb
87
+ - test/**/*.rb
88
+ - examples/**/*.rb
89
+
90
+ Metrics/ModuleLength:
91
+ Exclude:
92
+ - lib/polyphony/extensions/core.rb
93
+ - examples/**/*.rb
94
+
95
+ Metrics/ClassLength:
96
+ Exclude:
97
+ - lib/polyphony/http/server/http1.rb
98
+ - test/**/*.rb
99
+ - examples/**/*.rb
100
+
101
+ Style/RegexpLiteral:
102
+ Enabled: false
103
+
104
+ Style/RescueModifier:
105
+ Exclude:
106
+ - lib/polyphony/auto_run.rb
107
+ - test/**/*.rb
108
+ - examples/**/*.rb
109
+
110
+ Style/Documentation:
111
+ Exclude:
112
+ - test/**/*.rb
113
+ - examples/**/*.rb
114
+
115
+ Style/FormatString:
116
+ Exclude:
117
+ - test/**/*.rb
118
+ - examples/**/*.rb
119
+
120
+ Style/FormatStringToken:
121
+ Exclude:
122
+ - test/**/*.rb
123
+ - examples/**/*.rb
124
+
125
+ Naming/MethodParameterName:
126
+ Exclude:
127
+ - test/**/*.rb
128
+ - examples/**/*.rb
129
+
130
+ Security/MarshalLoad:
131
+ Exclude:
132
+ - examples/**/*.rb
133
+
134
+ Lint/ShadowedArgument:
135
+ Exclude:
136
+ - lib/polyphony/extensions/fiber.rb
137
+
138
+ Style/HashEachMethods:
139
+ Enabled: true
140
+
141
+ Style/HashTransformKeys:
142
+ Enabled: true
143
+
144
+ Style/HashTransformValues:
145
+ Enabled: true
146
+
147
+ Layout/EmptyLinesAroundAttributeAccessor:
148
+ Enabled: true
149
+
150
+ Layout/SpaceAroundMethodCallOperator:
151
+ Enabled: true
152
+
153
+ Lint/DeprecatedOpenSSLConstant:
154
+ Enabled: true
155
+
156
+ Lint/MixedRegexpCaptureTypes:
157
+ Enabled: true
158
+
159
+ Lint/RaiseException:
160
+ Enabled: true
161
+
162
+ Lint/StructNewOverride:
163
+ Enabled: true
164
+
165
+ Style/ExponentialNotation:
166
+ Enabled: true
167
+
168
+ Style/RedundantRegexpCharacterClass:
169
+ Enabled: true
170
+
171
+ Style/RedundantRegexpEscape:
172
+ Enabled: true
173
+
174
+ Style/SlicingWithRange:
175
+ Enabled: true
@@ -0,0 +1,393 @@
1
+ ## 0.43.8 2020-07-21
2
+
3
+ * Rename `LibevQueue` to `Queue`
4
+ * Reimplement Event using `Agent#wait_event`
5
+ * Improve Queue shift queue performance
6
+ * Introduce `Agent#wait_event` API for waiting on asynchronous events
7
+ * Minimize `fcntl` syscalls in IO operations
8
+
9
+ ## 0.43.7 2020-07-20
10
+
11
+ * Fix memory leak in ResourcePool (#31)
12
+ * Check and adjust file position before reading (#30)
13
+ * Minor documentation fixes
14
+
15
+ ## 0.43.6 2020-07-18
16
+
17
+ * Allow brute-force interrupting with second Ctrl-C
18
+ * Fix outgoing SSL connections (#28)
19
+ * Improve Fiber#await_all_children with many children
20
+ * Use `writev` for writing multiple strings
21
+ * Add logo (thanks [Gerald](https://webocube.com/)!)
22
+
23
+ ## 0.43.5 2020-07-13
24
+
25
+ * Fix `#read_nonblock`, `#write_nonblock` for `IO` and `Socket` (#27)
26
+ * Patch `Kernel#p`, `IO#puts` to issue single write call
27
+ * Add support for multiple arguments in `IO#write` and `LibevAgent#write`
28
+ * Use LibevQueue for fiber run queue
29
+ * Reimplement LibevQueue as ring buffer
30
+
31
+ ## 0.43.4 2020-07-09
32
+
33
+ * Reimplement Kernel#trap
34
+ * Dynamically allocate read buffer if length not given (#23)
35
+ * Prevent CPU saturation on infinite sleep (#24)
36
+
37
+ ## 0.43.3 2020-07-08
38
+
39
+ * Fix behaviour after call to `Process.daemon` (#8)
40
+ * Replace core `Queue` class with `Polyphony::Queue` (#22)
41
+ * Make `ResourcePool` reentrant (#1)
42
+ * Accept `:with_exception` argument in `cancel_after` (#16)
43
+
44
+ ## 0.43.2 2020-07-07
45
+
46
+ * Fix sending Redis commands with array arguments (#21)
47
+
48
+ ## 0.43.1 2020-06
49
+
50
+ * Fix compiling C-extension on MacOS (#20)
51
+
52
+ ## 0.43 2020-07-05
53
+
54
+ * Add IO#read_loop
55
+ * Fix OpenSSL extension
56
+ * More work on docs
57
+
58
+ ## 0.42 2020-07-03
59
+
60
+ * Improve documentation
61
+ * Fix backtrace on SIGINT
62
+ * Implement LibevAgent#accept_loop, #read_loop
63
+ * Move ref counting from thread to agent
64
+ * Short circuit switchpoint if continuing with the same fiber
65
+ * Always do a switchpoint in #read, #write, #accept
66
+
67
+ ## 0.41 2020-06-27
68
+
69
+ * Introduce System Agent design, remove all `Gyro` classes
70
+
71
+ ## 0.40 2020-05-04
72
+
73
+ * More improvements to stability after fork
74
+
75
+ ## 0.38 2020-04-13
76
+
77
+ * Fix post-fork segfault if parent process has multiple threads with active watchers
78
+
79
+ ## 0.37 2020-04-07
80
+
81
+ * Explicitly kill threads on exit to prevent possible segfault
82
+ * Remove Modulation dependency
83
+
84
+ ## 0.36 2020-03-31
85
+
86
+ * More docs
87
+ * More C code refactoring
88
+ * Fix freeing for active child, signal watchers
89
+
90
+ ## 0.35 2020-03-29
91
+
92
+ * Rename `Fiber#cancel!` to `Fiber#cancel`
93
+ * Rename `Gyro::Async#signal!` to `Gyro::Async#signal`
94
+ * Use `Fiber#auto_watcher` in thread pool, thread extension
95
+ * Implement `Fiber#auto_io` for reusing IO watcher instances
96
+ * Refactor C code
97
+
98
+ ## 0.34 2020-03-25
99
+
100
+ * Add `Fiber#auto_watcher` mainly for use in places like `Gyro::Queue#shift`
101
+ * Refactor C extension
102
+ * Improved GC'ing for watchers
103
+ * Implement process supervisor (`Polyphony::ProcessSupervisor`)
104
+ * Improve fiber supervision
105
+ * Fix forking behaviour
106
+ * Use correct backtrace for fiber control exceptions
107
+ * Allow calling `move_on_after` and `cancel_after` without block
108
+
109
+ ## 0.33 2020-03-08
110
+
111
+ * Implement `Fiber#supervise` (WIP)
112
+ * Add `Fiber#restart` API
113
+ * Fix race condition in `Thread#join`, `Thread#raise` (#14)
114
+ * Add `Exception#source_fiber` - references the fiber in which an uncaught
115
+ exception occurred
116
+
117
+ ## 0.32 2020-02-29
118
+
119
+ * Accept optional throttling rate in `#spin_loop`
120
+ * Remove CancelScope
121
+ * Allow spinning fibers from a parent fiber other than the current
122
+ * Add `#receive_pending` global API.
123
+ * Prevent race condition in `Gyro::Queue`.
124
+ * Improve signal handling - `INT`, `TERM` signals are now always handled in the
125
+ main fiber
126
+ * Fix adapter requires (redis and postgres)
127
+
128
+ ## 0.31 2020-02-20
129
+
130
+ * Fix signal handling race condition (#13)
131
+ * Move adapter code into polyphony/adapters
132
+ * Fix spin_loop caller, add tag parameter
133
+
134
+ ## 0.30 2020-02-04
135
+
136
+ * Add support for awaiting a fiber from multiple monitor fibers at once
137
+ * Implemented child fibers
138
+ * Fix TERM and INT signal handling (#11)
139
+ * Fix compiling on Linux
140
+ * Do not reset runnable value in Gyro_suspend (prevents interrupting timers)
141
+ * Don't snooze when stopping a fiber
142
+ * Fix IO#read for files larger than 8KB (#10)
143
+ * Fix fiber messaging in main fiber
144
+ * Prevent signalling of inactive async watcher
145
+ * Better fiber messaging
146
+
147
+ ## 0.29 2020-02-02
148
+
149
+ * Pass SignalException to main fiber
150
+ * Add (restore) default thread pool
151
+ * Prevent race condition in Thread#join
152
+ * Add support for cross-thread fiber scheduling
153
+ * Remove `#defer` global method
154
+ * Prevent starvation of waiting fibers when using snooze (#7)
155
+ * Improve tracing
156
+ * Fix IRB adapter
157
+
158
+ ## 0.28 2020-01-27
159
+
160
+ * Accept block in Supervisor#initialize
161
+ * Refactor `ThreadPool`
162
+ * Implement fiber switch events for `TracePoint`
163
+ * Add optional tag parameter to #spin
164
+ * Correctly increment ref count for indefinite sleep
165
+ * Add `irb` adapter
166
+ * Add support for listen/notify to postgres adapter
167
+ * Use `:waiting`, `:runnable`, `:running`, `:dead` for fiber states
168
+ * Move docs to https://digital-fabric.github.io/polyphony/
169
+
170
+ ## 0.27 2020-01-19
171
+
172
+ * Reimplement `Throttler` using recurring timer
173
+ * Add `Gyro::Selector` for wrapping libev
174
+ * Add `Gyro::Queue`, a fiber-aware thread-safe queue
175
+ * Implement multithreaded fiber scheduling
176
+
177
+ ## 0.26 2020-01-12
178
+
179
+ * Optimize `IO#read_watcher`, `IO#write_watcher`
180
+ * Implement `Fiber#raise`
181
+ * Fix `Kernel#gets` with `ARGV`
182
+ * Return `[pid, exit_status]` from `Gyro::Child#await`
183
+
184
+ ## 0.25 2020-01-10
185
+
186
+ * Fold `Coprocess` functionality into `Fiber`
187
+ * Add support for indefinite `#sleep`
188
+
189
+ ## 0.24 2020-01-08
190
+
191
+ * Extract HTTP code into separate polyphony-http gem
192
+ * Cull core, io examples
193
+ * Remove `SIGINT` handler
194
+
195
+ ## 0.23 2020-01-07
196
+
197
+ * Remove `API#pulse`
198
+ * Better repeat timer, reimplement `API#every`
199
+ * Move global API methods to separate module, include in `Object` instead of
200
+ `Kernel`
201
+ * Improve setting root fiber and corresponding coprocess
202
+ * Fix `ResourcePool#preheat!`
203
+ * Rename `$Coprocess#list` to `Coprocess#map`
204
+ * Fix `CancelScope#on_cancel`, remove `CancelScope#protect`
205
+ * Remove `auto_run` mechanism. Just use `suspend`!
206
+ * Optional coverage report for tests
207
+ * More tests
208
+ * Add `Coprocess.select` and `Supervisor#select` methods
209
+ * Add `Coprocess.join` alias to `Coprocess.await` method
210
+ * Add support for cancelling multiple coprocesses with a single cancel scope
211
+ * Fix stopping a coprocess before it being scheduled for the first time
212
+ * Rewrite `thread`, `thread_pool` modules
213
+ * Add `Kernel#orig_sleep` alias to sync `#sleep` method
214
+ * Add optional resume value to `Gyro::Async#signal!`
215
+ * Patch Fiber#inspect to show correct block location
216
+ * Add Gyro.run
217
+ * Move away from callback-based API for `Gyro::Timer`, `Gyro::Signal`
218
+
219
+ ## 0.22 2020-01-02
220
+
221
+ * Redesign Gyro scheduling subsystem, go scheduler-less
222
+ * More docs
223
+ * Rewrite HTTP client agent c1b63787
224
+ * Increment Gyro refcount in ResourcePool#acquire
225
+ * Rewrite ResourcePool
226
+ * Fix socket extensions
227
+ * Fix ALPN setup in Net.secure_socket
228
+
229
+ ## 0.21 2019-12-12
230
+
231
+ * Add Coprocess.await (for waiting for multiple coprocesses)
232
+ * Add Coprocess#caller, Coprocess#location methods
233
+ * Remove callback-oriented Gyro APIs
234
+ * Revise signal handling API
235
+ * Improve error handling in HTTP/2 adapter
236
+ * More documentation
237
+
238
+ ## 0.20 2019-11-27
239
+
240
+ * Refactor and improve CancelScope, ResourcePool
241
+ * Reimplement cancel_after, move_on_after using plain timers
242
+ * Use Timer#await instead of Timer#start in Pulser
243
+ * Rename Fiber.main to Fiber.root
244
+ * Replace use of defer with proper fiber scheduling
245
+ * Improve Coprocess resume, interrupt, cancel methods
246
+ * Cleanup code using Rubocop
247
+ * Update and cleanup examples
248
+ * Remove fiber pool
249
+ * Rename `CoprocessInterrupt` to `Interrupt`
250
+ * Fix ResourcePool, Mutex, Thread, ThreadPool
251
+ * Fix coprocess message passing behaviour
252
+ * Add HTTP::Request#consume API
253
+ * Use bundler 2.x
254
+ * Remove separate parse loop fiber in HTTP 1, HTTP 2 adapters
255
+ * Fix handling of exceptions in coprocesses
256
+ * Implement synthetic, sanitized exception backtrace showing control flow across
257
+ fibers
258
+ * Fix channels
259
+ * Fix HTTP1 connection shutdown and error states
260
+ * Workaround for IO#read without length
261
+ * Rename `next_tick` to `defer`
262
+ * Fix race condition in firing of deferred items, use linked list instead of
263
+ array for deferred items
264
+ * Rename `EV` module to `Gyro`
265
+ * Keep track of main fiber when forking
266
+ * Add `<<` alias for `send_chunk` in HTTP::Request
267
+ * Implement Socket#accept in C
268
+ * Better conformance of rack adapter to rack spec (WIP)
269
+ * Fix HTTP1 adapter
270
+ * Better support for debugging with ruby-debug-ide (WIP)
271
+
272
+ ## 0.19 2019-06-12
273
+
274
+ * Rewrite HTTP server for better concurrency, sequential API
275
+ * Support 204 no-content response in HTTP 1
276
+ * Add optional count parameter to Kernel#throttled_loop for finite looping
277
+ * Implement Fiber#safe_transfer in C
278
+ * Optimize Kernel#next_tick implementation using ev_idle instead of ev_timer
279
+
280
+ ## 0.18 2019-06-08
281
+
282
+ * Rename Kernel#coproc to Kernel#spin
283
+ * Rewrite Supervisor#spin
284
+
285
+ ## 0.17 2019-05-24
286
+
287
+ * Implement IO#read_watcher, IO#write_watcher in C for better performance
288
+ * Implement nonblocking (yielding) versions of Kernel#system, IO.popen,
289
+ Process.detach, IO#gets IO#puts, other IO singleton methods
290
+ * Add Coprocess#join as alias to Coprocess#await
291
+ * Rename Kernel#spawn to Kernel#coproc
292
+ * Fix encoding of strings read with IO#read, IO#readpartial
293
+ * Fix non-blocking behaviour of IO#read, IO#readpartial, IO#write
294
+
295
+ ## 0.16 2019-05-22
296
+
297
+ * Reorganize and refactor code
298
+ * Allow opening secure socket without OpenSSL context
299
+
300
+ ## 0.15 2019-05-20
301
+
302
+ * Optimize `#next_tick` callback (about 6% faster than before)
303
+ * Fix IO#<< to return self
304
+ * Refactor HTTP code and examples
305
+ * Fix race condition in `Supervisor#stop!`
306
+ * Add `Kernel#snooze` method (`EV.snooze` will be deprecated eventually)
307
+
308
+ ## 0.14 2019-05-17
309
+
310
+ * Use chunked encoding in HTTP 1 response
311
+ * Rewrite `IO#read`, `#readpartial`, `#write` in C (about 30% performance improvement)
312
+ * Add method delegation to `ResourcePool`
313
+ * Optimize PG::Connection#async_exec
314
+ * Fix `Coprocess#cancel!`
315
+ * Preliminary support for websocket (see `examples/io/http_ws_server.rb`)
316
+ * Rename `Coroutine` to `Coprocess`
317
+
318
+ ## 0.13 2019-01-05
319
+
320
+ * Rename Rubato to Polyphony (I know, this is getting silly...)
321
+
322
+ ## 0.12 2019-01-01
323
+
324
+ * Add Coroutine#resume
325
+ * Improve startup time
326
+ * Accept rate: or interval: arguments for throttle
327
+ * Set correct backtrace for errors
328
+ * Improve handling of uncaught raised errors
329
+ * Implement HTTP 1.1/2 client agent with connection management
330
+
331
+ ## 0.11 2018-12-27
332
+
333
+ * Move reactor loop to secondary fiber, allow blocking operations on main
334
+ fiber.
335
+ * Example implementation of erlang-style generic server pattern (implement async
336
+ API to a coroutine)
337
+ * Implement coroutine mailboxes, Coroutine#<<, Coroutine#receive, Kernel.receive
338
+ for message passing
339
+ * Add Coroutine.current for getting current coroutine
340
+
341
+ ## 0.10 2018-11-20
342
+
343
+ * Rewrite Rubato core for simpler code and better performance
344
+ * Implement EV.snooze (sleep until next tick)
345
+ * Coroutine encapsulates a task spawned on a separate fiber
346
+ * Supervisor supervises multiple coroutines
347
+ * CancelScope used to cancel an ongoing task (usually with a timeout)
348
+ * Rate throttling
349
+ * Implement async SSL server
350
+
351
+ ## 0.9 2018-11-14
352
+
353
+ * Rename Nuclear to Rubato
354
+
355
+ ## 0.8 2018-10-04
356
+
357
+ * Replace nio4r with in-house extension based on libev, with better API,
358
+ better performance, support for IO, timer, signal and async watchers
359
+ * Fix mem leak coming from nio4r (probably related to code in Selector#select)
360
+
361
+ ## 0.7 2018-09-13
362
+
363
+ * Implement resource pool
364
+ * transaction method for pg cient
365
+ * Async connect for pg client
366
+ * Add testing module for testing async code
367
+ * Improve HTTP server performance
368
+ * Proper promise chaining
369
+
370
+ ## 0.6 2018-09-11
371
+
372
+ * Add http, redis, pg dependencies
373
+ * Move ALPN code inside net module
374
+
375
+ ## 0.4 2018-09-10
376
+
377
+ * Code refactored and reogranized
378
+ * Fix recursion in next_tick
379
+ * HTTP 2 server with support for ALPN protocol negotiation and HTTP upgrade
380
+ * OpenSSL server
381
+
382
+ ## 0.3 2018-09-06
383
+
384
+ * Event reactor
385
+ * Timers
386
+ * Promises
387
+ * async/await syntax for promises
388
+ * IO and read/write stream
389
+ * TCP server/client
390
+ * Promised threads
391
+ * HTTP server
392
+ * Redis interface
393
+ * PostgreSQL interface