polyphony 0.47.2 → 0.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +317 -293
  3. data/Gemfile.lock +1 -1
  4. data/TODO.md +46 -3
  5. data/examples/core/supervisor.rb +3 -3
  6. data/examples/core/worker-thread.rb +3 -4
  7. data/examples/io/tcp_proxy.rb +32 -0
  8. data/examples/io/unix_socket.rb +26 -0
  9. data/examples/performance/line_splitting.rb +34 -0
  10. data/examples/performance/loop.rb +32 -0
  11. data/examples/performance/thread-vs-fiber/polyphony_server.rb +6 -0
  12. data/ext/polyphony/backend_common.h +2 -2
  13. data/ext/polyphony/backend_io_uring.c +42 -83
  14. data/ext/polyphony/backend_libev.c +32 -77
  15. data/ext/polyphony/event.c +1 -1
  16. data/ext/polyphony/polyphony.c +0 -2
  17. data/ext/polyphony/polyphony.h +5 -4
  18. data/ext/polyphony/queue.c +2 -2
  19. data/ext/polyphony/thread.c +9 -28
  20. data/lib/polyphony/adapters/postgres.rb +3 -3
  21. data/lib/polyphony/core/global_api.rb +19 -16
  22. data/lib/polyphony/core/resource_pool.rb +1 -12
  23. data/lib/polyphony/core/thread_pool.rb +3 -1
  24. data/lib/polyphony/core/throttler.rb +1 -1
  25. data/lib/polyphony/extensions/fiber.rb +34 -8
  26. data/lib/polyphony/extensions/io.rb +8 -14
  27. data/lib/polyphony/extensions/openssl.rb +4 -4
  28. data/lib/polyphony/extensions/socket.rb +68 -16
  29. data/lib/polyphony/version.rb +1 -1
  30. data/polyphony.gemspec +1 -1
  31. data/test/helper.rb +1 -0
  32. data/test/test_backend.rb +1 -1
  33. data/test/test_fiber.rb +64 -0
  34. data/test/test_global_api.rb +41 -1
  35. data/test/test_io.rb +26 -0
  36. data/test/test_resource_pool.rb +0 -21
  37. data/test/test_signal.rb +18 -0
  38. data/test/test_socket.rb +27 -2
  39. data/test/test_supervise.rb +2 -1
  40. metadata +7 -4
  41. data/ext/polyphony/backend.h +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f9e7ffec31a2009f8000e7b88473e21581de37640ee2d5c6357550883d7bc7c
4
- data.tar.gz: d3f8262b8373e7a337dacc0c8e04b1b25ddf0254445b146787a5aa82520dee30
3
+ metadata.gz: 3a699d313072b1beba17c900491dd2a4f454bc8faea69eb157634e98cba7ee90
4
+ data.tar.gz: 3d8579b2c927c34876560ce878e960b9bc48a857ce43890dc069b4f0fa5ad75f
5
5
  SHA512:
6
- metadata.gz: 0203bd8d66851f3eeed446f7537183e5b66a422f5f5c68b79a1b99f5c3762e243d1027cd77ccbe255012b9450a56b336c9da2e78e91b867adee8f3353351db7c
7
- data.tar.gz: 74ef01b9828d4ba0c6a67cd8a402551484c935234fb7d259146d6cfd5033149f7376aa98068dc8f30168c0ec783015208326455795926d02b385e1bda27d1f37
6
+ metadata.gz: d6efca5f42f21fe25ab5e6064675c2806dcad9d86e2e80c908987fcce855dd520ab51c4913e5a9001d3e4a84880a6606d124fa46dedff7c2e437a1ef6e156a82
7
+ data.tar.gz: 73ad6c59d4f7e9f8f0d317f480be1ba33c1a70dcf130a717693c2bb5a9ef3e226bfff3bdb635461b505bd2e9bbec7a2174c6a206bee2a94709ba9739ab087956
@@ -1,488 +1,512 @@
1
+ ## 0.48.0
2
+
3
+ - Implement graceful shutdown
4
+ - Add support for `break` / `StopIteration` in `spin_loop`
5
+ - Fix `IO#gets`, `IO#readpartial`
6
+
7
+ ## 0.47.5.1
8
+
9
+ - Add missing `Socket#accept_loop` method
10
+
11
+ ## 0.47.5
12
+
13
+ - Add `socket_class` argument to `Backend#accept`, `Backend#accept_loop`
14
+ - Fix `#supervise` to stop when all children fibers are done
15
+
16
+ ## 0.47.4
17
+
18
+ - Add support for Unix sockets
19
+
20
+ ## 0.47.3
21
+
22
+ - Enable I/O in signal handlers (#45)
23
+ - Accept `:interval` argument in `#spin_loop`
24
+
1
25
  ## 0.47.2
2
26
 
3
- * Fix API compatibility between TCPSocket and IO
27
+ - Fix API compatibility between TCPSocket and IO
4
28
 
5
29
  ## 0.47.0
6
30
 
7
- * Implement `#spin_scope` used for creating blocking fiber scopes
8
- * Reimplement `move_on_after`, `cancel_after`, `Timeout.timeout` using
31
+ - Implement `#spin_scope` used for creating blocking fiber scopes
32
+ - Reimplement `move_on_after`, `cancel_after`, `Timeout.timeout` using
9
33
  `Backend#timeout` (avoids creating canceller fiber for most common use case)
10
- * Implement `Backend#timeout` API
11
- * Implemented capped queues
34
+ - Implement `Backend#timeout` API
35
+ - Implemented capped queues
12
36
 
13
37
  ## 0.46.1
14
38
 
15
- * Add `TCPServer#accept_loop`, `OpenSSL::SSL::SSLSocket#accept_loop` method
16
- * Fix compilation error on MacOS (#43)
17
- * Fix backtrace for `Timeout.timeout`
18
- * Add `Backend#timer_loop`
39
+ - Add `TCPServer#accept_loop`, `OpenSSL::SSL::SSLSocket#accept_loop` method
40
+ - Fix compilation error on MacOS (#43)
41
+ - Fix backtrace for `Timeout.timeout`
42
+ - Add `Backend#timer_loop`
19
43
 
20
44
  ## 0.46.0
21
45
 
22
- * Implement [io_uring backend](https://github.com/digital-fabric/polyphony/pull/44)
46
+ - Implement [io_uring backend](https://github.com/digital-fabric/polyphony/pull/44)
23
47
 
24
48
  ## 0.45.5
25
49
 
26
- * Fix compilation error (#43)
27
- * Add support for resetting move_on_after, cancel_after timeouts
28
- * Optimize anti-event starvation polling
29
- * Implement optimized runqueue for better performance
30
- * Schedule parent with priority on uncaught exception
31
- * Fix race condition in `Mutex#synchronize` (#41)
50
+ - Fix compilation error (#43)
51
+ - Add support for resetting move_on_after, cancel_after timeouts
52
+ - Optimize anti-event starvation polling
53
+ - Implement optimized runqueue for better performance
54
+ - Schedule parent with priority on uncaught exception
55
+ - Fix race condition in `Mutex#synchronize` (#41)
32
56
 
33
57
  ## 0.45.4
34
58
 
35
- * Improve signal trapping mechanism
59
+ - Improve signal trapping mechanism
36
60
 
37
61
  ## 0.45.3
38
62
 
39
- * Don't swallow error in `Process#kill_and_await`
40
- * Add `Fiber#mailbox` attribute reader
41
- * Fix bug in `Fiber.await`
42
- * Implement `IO#getc`, `IO#getbyte`
63
+ - Don't swallow error in `Process#kill_and_await`
64
+ - Add `Fiber#mailbox` attribute reader
65
+ - Fix bug in `Fiber.await`
66
+ - Implement `IO#getc`, `IO#getbyte`
43
67
 
44
68
  ## 0.45.2
45
69
 
46
- * Rewrite `Fiber#<<`, `Fiber#await`, `Fiber#receive` in C
70
+ - Rewrite `Fiber#<<`, `Fiber#await`, `Fiber#receive` in C
47
71
 
48
72
  ## 0.45.1
49
73
 
50
- * Fix Net::HTTP compatibility
51
- * Fix fs adapter
52
- * Improve performance of IO#puts
53
- * Mutex#synchronize
54
- * Fix Socket#connect
55
- * Cleanup code
56
- * Improve support for Ruby 3 keyword args
74
+ - Fix Net::HTTP compatibility
75
+ - Fix fs adapter
76
+ - Improve performance of IO#puts
77
+ - Mutex#synchronize
78
+ - Fix Socket#connect
79
+ - Cleanup code
80
+ - Improve support for Ruby 3 keyword args
57
81
 
58
82
  ## 0.45.0
59
83
 
60
- * Cleanup code
61
- * Rename `Agent` to `Backend`
62
- * Implement `Polyphony::ConditionVariable`
63
- * Fix Kernel.system
84
+ - Cleanup code
85
+ - Rename `Agent` to `Backend`
86
+ - Implement `Polyphony::ConditionVariable`
87
+ - Fix Kernel.system
64
88
 
65
89
  ## 0.44.0 2020-07-25
66
90
 
67
- * Fix reentrant `ResourcePool` (#38)
68
- * Add `ResourcePool#discard!` (#35)
69
- * Add `Mysql2::Client` and `Sequel::ConnectionPool` adapters (#35)
70
- * Reimplement `Kernel.trap` using `Fiber#interject`
71
- * Add `Fiber#interject` for running arbitrary code on arbitrary fibers (#39)
91
+ - Fix reentrant `ResourcePool` (#38)
92
+ - Add `ResourcePool#discard!` (#35)
93
+ - Add `Mysql2::Client` and `Sequel::ConnectionPool` adapters (#35)
94
+ - Reimplement `Kernel.trap` using `Fiber#interject`
95
+ - Add `Fiber#interject` for running arbitrary code on arbitrary fibers (#39)
72
96
 
73
97
  ## 0.43.11 2020-07-24
74
98
 
75
- * Dump uncaught exception info for forked process (#36)
76
- * Add additional socket config options (#37)
99
+ - Dump uncaught exception info for forked process (#36)
100
+ - Add additional socket config options (#37)
77
101
  - :reuse_port (`SO_REUSEPORT`)
78
102
  - :backlog (listen backlog, default `SOMAXCONN`)
79
- * Fix possible race condition in Queue#shift (#34)
103
+ - Fix possible race condition in Queue#shift (#34)
80
104
 
81
105
  ## 0.43.10 2020-07-23
82
106
 
83
- * Fix race condition when terminating fibers (#33)
84
- * Fix lock release in `Mutex` (#32)
85
- * Virtualize agent interface
86
- * Implement `LibevAgent_connect`
107
+ - Fix race condition when terminating fibers (#33)
108
+ - Fix lock release in `Mutex` (#32)
109
+ - Virtualize agent interface
110
+ - Implement `LibevAgent_connect`
87
111
 
88
112
  ## 0.43.9 2020-07-22
89
113
 
90
- * Rewrite `Channel` using `Queue`
91
- * Rewrite `Mutex` using `Queue`
92
- * Reimplement `Event` in C to prevent cross-thread race condition
93
- * Reimplement `ResourcePool` using `Queue`
94
- * Implement `Queue#size`
114
+ - Rewrite `Channel` using `Queue`
115
+ - Rewrite `Mutex` using `Queue`
116
+ - Reimplement `Event` in C to prevent cross-thread race condition
117
+ - Reimplement `ResourcePool` using `Queue`
118
+ - Implement `Queue#size`
95
119
 
96
120
  ## 0.43.8 2020-07-21
97
121
 
98
- * Rename `LibevQueue` to `Queue`
99
- * Reimplement Event using `Agent#wait_event`
100
- * Improve Queue shift queue performance
101
- * Introduce `Agent#wait_event` API for waiting on asynchronous events
102
- * Minimize `fcntl` syscalls in IO operations
122
+ - Rename `LibevQueue` to `Queue`
123
+ - Reimplement Event using `Agent#wait_event`
124
+ - Improve Queue shift queue performance
125
+ - Introduce `Agent#wait_event` API for waiting on asynchronous events
126
+ - Minimize `fcntl` syscalls in IO operations
103
127
 
104
128
  ## 0.43.7 2020-07-20
105
129
 
106
- * Fix memory leak in ResourcePool (#31)
107
- * Check and adjust file position before reading (#30)
108
- * Minor documentation fixes
130
+ - Fix memory leak in ResourcePool (#31)
131
+ - Check and adjust file position before reading (#30)
132
+ - Minor documentation fixes
109
133
 
110
134
  ## 0.43.6 2020-07-18
111
135
 
112
- * Allow brute-force interrupting with second Ctrl-C
113
- * Fix outgoing SSL connections (#28)
114
- * Improve Fiber#await_all_children with many children
115
- * Use `writev` for writing multiple strings
116
- * Add logo (thanks [Gerald](https://webocube.com/)!)
136
+ - Allow brute-force interrupting with second Ctrl-C
137
+ - Fix outgoing SSL connections (#28)
138
+ - Improve Fiber#await_all_children with many children
139
+ - Use `writev` for writing multiple strings
140
+ - Add logo (thanks [Gerald](https://webocube.com/)!)
117
141
 
118
142
  ## 0.43.5 2020-07-13
119
143
 
120
- * Fix `#read_nonblock`, `#write_nonblock` for `IO` and `Socket` (#27)
121
- * Patch `Kernel#p`, `IO#puts` to issue single write call
122
- * Add support for multiple arguments in `IO#write` and `LibevAgent#write`
123
- * Use LibevQueue for fiber run queue
124
- * Reimplement LibevQueue as ring buffer
144
+ - Fix `#read_nonblock`, `#write_nonblock` for `IO` and `Socket` (#27)
145
+ - Patch `Kernel#p`, `IO#puts` to issue single write call
146
+ - Add support for multiple arguments in `IO#write` and `LibevAgent#write`
147
+ - Use LibevQueue for fiber run queue
148
+ - Reimplement LibevQueue as ring buffer
125
149
 
126
150
  ## 0.43.4 2020-07-09
127
151
 
128
- * Reimplement Kernel#trap
129
- * Dynamically allocate read buffer if length not given (#23)
130
- * Prevent CPU saturation on infinite sleep (#24)
152
+ - Reimplement Kernel#trap
153
+ - Dynamically allocate read buffer if length not given (#23)
154
+ - Prevent CPU saturation on infinite sleep (#24)
131
155
 
132
156
  ## 0.43.3 2020-07-08
133
157
 
134
- * Fix behaviour after call to `Process.daemon` (#8)
135
- * Replace core `Queue` class with `Polyphony::Queue` (#22)
136
- * Make `ResourcePool` reentrant (#1)
137
- * Accept `:with_exception` argument in `cancel_after` (#16)
158
+ - Fix behaviour after call to `Process.daemon` (#8)
159
+ - Replace core `Queue` class with `Polyphony::Queue` (#22)
160
+ - Make `ResourcePool` reentrant (#1)
161
+ - Accept `:with_exception` argument in `cancel_after` (#16)
138
162
 
139
163
  ## 0.43.2 2020-07-07
140
164
 
141
- * Fix sending Redis commands with array arguments (#21)
165
+ - Fix sending Redis commands with array arguments (#21)
142
166
 
143
167
  ## 0.43.1 2020-06
144
168
 
145
- * Fix compiling C-extension on MacOS (#20)
169
+ - Fix compiling C-extension on MacOS (#20)
146
170
 
147
171
  ## 0.43 2020-07-05
148
172
 
149
- * Add IO#read_loop
150
- * Fix OpenSSL extension
151
- * More work on docs
173
+ - Add IO#read_loop
174
+ - Fix OpenSSL extension
175
+ - More work on docs
152
176
 
153
177
  ## 0.42 2020-07-03
154
178
 
155
- * Improve documentation
156
- * Fix backtrace on SIGINT
157
- * Implement LibevAgent#accept_loop, #read_loop
158
- * Move ref counting from thread to agent
159
- * Short circuit switchpoint if continuing with the same fiber
160
- * Always do a switchpoint in #read, #write, #accept
179
+ - Improve documentation
180
+ - Fix backtrace on SIGINT
181
+ - Implement LibevAgent#accept_loop, #read_loop
182
+ - Move ref counting from thread to agent
183
+ - Short circuit switchpoint if continuing with the same fiber
184
+ - Always do a switchpoint in #read, #write, #accept
161
185
 
162
186
  ## 0.41 2020-06-27
163
187
 
164
- * Introduce System Agent design, remove all `Gyro` classes
188
+ - Introduce System Agent design, remove all `Gyro` classes
165
189
 
166
190
  ## 0.40 2020-05-04
167
191
 
168
- * More improvements to stability after fork
192
+ - More improvements to stability after fork
169
193
 
170
194
  ## 0.38 2020-04-13
171
195
 
172
- * Fix post-fork segfault if parent process has multiple threads with active watchers
196
+ - Fix post-fork segfault if parent process has multiple threads with active watchers
173
197
 
174
198
  ## 0.37 2020-04-07
175
199
 
176
- * Explicitly kill threads on exit to prevent possible segfault
177
- * Remove Modulation dependency
200
+ - Explicitly kill threads on exit to prevent possible segfault
201
+ - Remove Modulation dependency
178
202
 
179
203
  ## 0.36 2020-03-31
180
204
 
181
- * More docs
182
- * More C code refactoring
183
- * Fix freeing for active child, signal watchers
205
+ - More docs
206
+ - More C code refactoring
207
+ - Fix freeing for active child, signal watchers
184
208
 
185
209
  ## 0.35 2020-03-29
186
210
 
187
- * Rename `Fiber#cancel!` to `Fiber#cancel`
188
- * Rename `Gyro::Async#signal!` to `Gyro::Async#signal`
189
- * Use `Fiber#auto_watcher` in thread pool, thread extension
190
- * Implement `Fiber#auto_io` for reusing IO watcher instances
191
- * Refactor C code
211
+ - Rename `Fiber#cancel!` to `Fiber#cancel`
212
+ - Rename `Gyro::Async#signal!` to `Gyro::Async#signal`
213
+ - Use `Fiber#auto_watcher` in thread pool, thread extension
214
+ - Implement `Fiber#auto_io` for reusing IO watcher instances
215
+ - Refactor C code
192
216
 
193
217
  ## 0.34 2020-03-25
194
218
 
195
- * Add `Fiber#auto_watcher` mainly for use in places like `Gyro::Queue#shift`
196
- * Refactor C extension
197
- * Improved GC'ing for watchers
198
- * Implement process supervisor (`Polyphony::ProcessSupervisor`)
199
- * Improve fiber supervision
200
- * Fix forking behaviour
201
- * Use correct backtrace for fiber control exceptions
202
- * Allow calling `move_on_after` and `cancel_after` without block
219
+ - Add `Fiber#auto_watcher` mainly for use in places like `Gyro::Queue#shift`
220
+ - Refactor C extension
221
+ - Improved GC'ing for watchers
222
+ - Implement process supervisor (`Polyphony::ProcessSupervisor`)
223
+ - Improve fiber supervision
224
+ - Fix forking behaviour
225
+ - Use correct backtrace for fiber control exceptions
226
+ - Allow calling `move_on_after` and `cancel_after` without block
203
227
 
204
228
  ## 0.33 2020-03-08
205
229
 
206
- * Implement `Fiber#supervise` (WIP)
207
- * Add `Fiber#restart` API
208
- * Fix race condition in `Thread#join`, `Thread#raise` (#14)
209
- * Add `Exception#source_fiber` - references the fiber in which an uncaught
230
+ - Implement `Fiber#supervise` (WIP)
231
+ - Add `Fiber#restart` API
232
+ - Fix race condition in `Thread#join`, `Thread#raise` (#14)
233
+ - Add `Exception#source_fiber` - references the fiber in which an uncaught
210
234
  exception occurred
211
235
 
212
236
  ## 0.32 2020-02-29
213
237
 
214
- * Accept optional throttling rate in `#spin_loop`
215
- * Remove CancelScope
216
- * Allow spinning fibers from a parent fiber other than the current
217
- * Add `#receive_pending` global API.
218
- * Prevent race condition in `Gyro::Queue`.
219
- * Improve signal handling - `INT`, `TERM` signals are now always handled in the
238
+ - Accept optional throttling rate in `#spin_loop`
239
+ - Remove CancelScope
240
+ - Allow spinning fibers from a parent fiber other than the current
241
+ - Add `#receive_pending` global API.
242
+ - Prevent race condition in `Gyro::Queue`.
243
+ - Improve signal handling - `INT`, `TERM` signals are now always handled in the
220
244
  main fiber
221
- * Fix adapter requires (redis and postgres)
245
+ - Fix adapter requires (redis and postgres)
222
246
 
223
247
  ## 0.31 2020-02-20
224
248
 
225
- * Fix signal handling race condition (#13)
226
- * Move adapter code into polyphony/adapters
227
- * Fix spin_loop caller, add tag parameter
249
+ - Fix signal handling race condition (#13)
250
+ - Move adapter code into polyphony/adapters
251
+ - Fix spin_loop caller, add tag parameter
228
252
 
229
253
  ## 0.30 2020-02-04
230
254
 
231
- * Add support for awaiting a fiber from multiple monitor fibers at once
232
- * Implemented child fibers
233
- * Fix TERM and INT signal handling (#11)
234
- * Fix compiling on Linux
235
- * Do not reset runnable value in Gyro_suspend (prevents interrupting timers)
236
- * Don't snooze when stopping a fiber
237
- * Fix IO#read for files larger than 8KB (#10)
238
- * Fix fiber messaging in main fiber
239
- * Prevent signalling of inactive async watcher
240
- * Better fiber messaging
255
+ - Add support for awaiting a fiber from multiple monitor fibers at once
256
+ - Implemented child fibers
257
+ - Fix TERM and INT signal handling (#11)
258
+ - Fix compiling on Linux
259
+ - Do not reset runnable value in Gyro_suspend (prevents interrupting timers)
260
+ - Don't snooze when stopping a fiber
261
+ - Fix IO#read for files larger than 8KB (#10)
262
+ - Fix fiber messaging in main fiber
263
+ - Prevent signalling of inactive async watcher
264
+ - Better fiber messaging
241
265
 
242
266
  ## 0.29 2020-02-02
243
267
 
244
- * Pass SignalException to main fiber
245
- * Add (restore) default thread pool
246
- * Prevent race condition in Thread#join
247
- * Add support for cross-thread fiber scheduling
248
- * Remove `#defer` global method
249
- * Prevent starvation of waiting fibers when using snooze (#7)
250
- * Improve tracing
251
- * Fix IRB adapter
268
+ - Pass SignalException to main fiber
269
+ - Add (restore) default thread pool
270
+ - Prevent race condition in Thread#join
271
+ - Add support for cross-thread fiber scheduling
272
+ - Remove `#defer` global method
273
+ - Prevent starvation of waiting fibers when using snooze (#7)
274
+ - Improve tracing
275
+ - Fix IRB adapter
252
276
 
253
277
  ## 0.28 2020-01-27
254
278
 
255
- * Accept block in Supervisor#initialize
256
- * Refactor `ThreadPool`
257
- * Implement fiber switch events for `TracePoint`
258
- * Add optional tag parameter to #spin
259
- * Correctly increment ref count for indefinite sleep
260
- * Add `irb` adapter
261
- * Add support for listen/notify to postgres adapter
262
- * Use `:waiting`, `:runnable`, `:running`, `:dead` for fiber states
263
- * Move docs to https://digital-fabric.github.io/polyphony/
279
+ - Accept block in Supervisor#initialize
280
+ - Refactor `ThreadPool`
281
+ - Implement fiber switch events for `TracePoint`
282
+ - Add optional tag parameter to #spin
283
+ - Correctly increment ref count for indefinite sleep
284
+ - Add `irb` adapter
285
+ - Add support for listen/notify to postgres adapter
286
+ - Use `:waiting`, `:runnable`, `:running`, `:dead` for fiber states
287
+ - Move docs to https://digital-fabric.github.io/polyphony/
264
288
 
265
289
  ## 0.27 2020-01-19
266
290
 
267
- * Reimplement `Throttler` using recurring timer
268
- * Add `Gyro::Selector` for wrapping libev
269
- * Add `Gyro::Queue`, a fiber-aware thread-safe queue
270
- * Implement multithreaded fiber scheduling
291
+ - Reimplement `Throttler` using recurring timer
292
+ - Add `Gyro::Selector` for wrapping libev
293
+ - Add `Gyro::Queue`, a fiber-aware thread-safe queue
294
+ - Implement multithreaded fiber scheduling
271
295
 
272
296
  ## 0.26 2020-01-12
273
297
 
274
- * Optimize `IO#read_watcher`, `IO#write_watcher`
275
- * Implement `Fiber#raise`
276
- * Fix `Kernel#gets` with `ARGV`
277
- * Return `[pid, exit_status]` from `Gyro::Child#await`
298
+ - Optimize `IO#read_watcher`, `IO#write_watcher`
299
+ - Implement `Fiber#raise`
300
+ - Fix `Kernel#gets` with `ARGV`
301
+ - Return `[pid, exit_status]` from `Gyro::Child#await`
278
302
 
279
303
  ## 0.25 2020-01-10
280
304
 
281
- * Fold `Coprocess` functionality into `Fiber`
282
- * Add support for indefinite `#sleep`
305
+ - Fold `Coprocess` functionality into `Fiber`
306
+ - Add support for indefinite `#sleep`
283
307
 
284
308
  ## 0.24 2020-01-08
285
309
 
286
- * Extract HTTP code into separate polyphony-http gem
287
- * Cull core, io examples
288
- * Remove `SIGINT` handler
310
+ - Extract HTTP code into separate polyphony-http gem
311
+ - Cull core, io examples
312
+ - Remove `SIGINT` handler
289
313
 
290
314
  ## 0.23 2020-01-07
291
315
 
292
- * Remove `API#pulse`
293
- * Better repeat timer, reimplement `API#every`
294
- * Move global API methods to separate module, include in `Object` instead of
316
+ - Remove `API#pulse`
317
+ - Better repeat timer, reimplement `API#every`
318
+ - Move global API methods to separate module, include in `Object` instead of
295
319
  `Kernel`
296
- * Improve setting root fiber and corresponding coprocess
297
- * Fix `ResourcePool#preheat!`
298
- * Rename `$Coprocess#list` to `Coprocess#map`
299
- * Fix `CancelScope#on_cancel`, remove `CancelScope#protect`
300
- * Remove `auto_run` mechanism. Just use `suspend`!
301
- * Optional coverage report for tests
302
- * More tests
303
- * Add `Coprocess.select` and `Supervisor#select` methods
304
- * Add `Coprocess.join` alias to `Coprocess.await` method
305
- * Add support for cancelling multiple coprocesses with a single cancel scope
306
- * Fix stopping a coprocess before it being scheduled for the first time
307
- * Rewrite `thread`, `thread_pool` modules
308
- * Add `Kernel#orig_sleep` alias to sync `#sleep` method
309
- * Add optional resume value to `Gyro::Async#signal!`
310
- * Patch Fiber#inspect to show correct block location
311
- * Add Gyro.run
312
- * Move away from callback-based API for `Gyro::Timer`, `Gyro::Signal`
320
+ - Improve setting root fiber and corresponding coprocess
321
+ - Fix `ResourcePool#preheat!`
322
+ - Rename `$Coprocess#list` to `Coprocess#map`
323
+ - Fix `CancelScope#on_cancel`, remove `CancelScope#protect`
324
+ - Remove `auto_run` mechanism. Just use `suspend`!
325
+ - Optional coverage report for tests
326
+ - More tests
327
+ - Add `Coprocess.select` and `Supervisor#select` methods
328
+ - Add `Coprocess.join` alias to `Coprocess.await` method
329
+ - Add support for cancelling multiple coprocesses with a single cancel scope
330
+ - Fix stopping a coprocess before it being scheduled for the first time
331
+ - Rewrite `thread`, `thread_pool` modules
332
+ - Add `Kernel#orig_sleep` alias to sync `#sleep` method
333
+ - Add optional resume value to `Gyro::Async#signal!`
334
+ - Patch Fiber#inspect to show correct block location
335
+ - Add Gyro.run
336
+ - Move away from callback-based API for `Gyro::Timer`, `Gyro::Signal`
313
337
 
314
338
  ## 0.22 2020-01-02
315
339
 
316
- * Redesign Gyro scheduling subsystem, go scheduler-less
317
- * More docs
318
- * Rewrite HTTP client agent c1b63787
319
- * Increment Gyro refcount in ResourcePool#acquire
320
- * Rewrite ResourcePool
321
- * Fix socket extensions
322
- * Fix ALPN setup in Net.secure_socket
340
+ - Redesign Gyro scheduling subsystem, go scheduler-less
341
+ - More docs
342
+ - Rewrite HTTP client agent c1b63787
343
+ - Increment Gyro refcount in ResourcePool#acquire
344
+ - Rewrite ResourcePool
345
+ - Fix socket extensions
346
+ - Fix ALPN setup in Net.secure_socket
323
347
 
324
348
  ## 0.21 2019-12-12
325
349
 
326
- * Add Coprocess.await (for waiting for multiple coprocesses)
327
- * Add Coprocess#caller, Coprocess#location methods
328
- * Remove callback-oriented Gyro APIs
329
- * Revise signal handling API
330
- * Improve error handling in HTTP/2 adapter
331
- * More documentation
350
+ - Add Coprocess.await (for waiting for multiple coprocesses)
351
+ - Add Coprocess#caller, Coprocess#location methods
352
+ - Remove callback-oriented Gyro APIs
353
+ - Revise signal handling API
354
+ - Improve error handling in HTTP/2 adapter
355
+ - More documentation
332
356
 
333
357
  ## 0.20 2019-11-27
334
358
 
335
- * Refactor and improve CancelScope, ResourcePool
336
- * Reimplement cancel_after, move_on_after using plain timers
337
- * Use Timer#await instead of Timer#start in Pulser
338
- * Rename Fiber.main to Fiber.root
339
- * Replace use of defer with proper fiber scheduling
340
- * Improve Coprocess resume, interrupt, cancel methods
341
- * Cleanup code using Rubocop
342
- * Update and cleanup examples
343
- * Remove fiber pool
344
- * Rename `CoprocessInterrupt` to `Interrupt`
345
- * Fix ResourcePool, Mutex, Thread, ThreadPool
346
- * Fix coprocess message passing behaviour
347
- * Add HTTP::Request#consume API
348
- * Use bundler 2.x
349
- * Remove separate parse loop fiber in HTTP 1, HTTP 2 adapters
350
- * Fix handling of exceptions in coprocesses
351
- * Implement synthetic, sanitized exception backtrace showing control flow across
359
+ - Refactor and improve CancelScope, ResourcePool
360
+ - Reimplement cancel_after, move_on_after using plain timers
361
+ - Use Timer#await instead of Timer#start in Pulser
362
+ - Rename Fiber.main to Fiber.root
363
+ - Replace use of defer with proper fiber scheduling
364
+ - Improve Coprocess resume, interrupt, cancel methods
365
+ - Cleanup code using Rubocop
366
+ - Update and cleanup examples
367
+ - Remove fiber pool
368
+ - Rename `CoprocessInterrupt` to `Interrupt`
369
+ - Fix ResourcePool, Mutex, Thread, ThreadPool
370
+ - Fix coprocess message passing behaviour
371
+ - Add HTTP::Request#consume API
372
+ - Use bundler 2.x
373
+ - Remove separate parse loop fiber in HTTP 1, HTTP 2 adapters
374
+ - Fix handling of exceptions in coprocesses
375
+ - Implement synthetic, sanitized exception backtrace showing control flow across
352
376
  fibers
353
- * Fix channels
354
- * Fix HTTP1 connection shutdown and error states
355
- * Workaround for IO#read without length
356
- * Rename `next_tick` to `defer`
357
- * Fix race condition in firing of deferred items, use linked list instead of
377
+ - Fix channels
378
+ - Fix HTTP1 connection shutdown and error states
379
+ - Workaround for IO#read without length
380
+ - Rename `next_tick` to `defer`
381
+ - Fix race condition in firing of deferred items, use linked list instead of
358
382
  array for deferred items
359
- * Rename `EV` module to `Gyro`
360
- * Keep track of main fiber when forking
361
- * Add `<<` alias for `send_chunk` in HTTP::Request
362
- * Implement Socket#accept in C
363
- * Better conformance of rack adapter to rack spec (WIP)
364
- * Fix HTTP1 adapter
365
- * Better support for debugging with ruby-debug-ide (WIP)
383
+ - Rename `EV` module to `Gyro`
384
+ - Keep track of main fiber when forking
385
+ - Add `<<` alias for `send_chunk` in HTTP::Request
386
+ - Implement Socket#accept in C
387
+ - Better conformance of rack adapter to rack spec (WIP)
388
+ - Fix HTTP1 adapter
389
+ - Better support for debugging with ruby-debug-ide (WIP)
366
390
 
367
391
  ## 0.19 2019-06-12
368
392
 
369
- * Rewrite HTTP server for better concurrency, sequential API
370
- * Support 204 no-content response in HTTP 1
371
- * Add optional count parameter to Kernel#throttled_loop for finite looping
372
- * Implement Fiber#safe_transfer in C
373
- * Optimize Kernel#next_tick implementation using ev_idle instead of ev_timer
393
+ - Rewrite HTTP server for better concurrency, sequential API
394
+ - Support 204 no-content response in HTTP 1
395
+ - Add optional count parameter to Kernel#throttled_loop for finite looping
396
+ - Implement Fiber#safe_transfer in C
397
+ - Optimize Kernel#next_tick implementation using ev_idle instead of ev_timer
374
398
 
375
399
  ## 0.18 2019-06-08
376
400
 
377
- * Rename Kernel#coproc to Kernel#spin
378
- * Rewrite Supervisor#spin
401
+ - Rename Kernel#coproc to Kernel#spin
402
+ - Rewrite Supervisor#spin
379
403
 
380
404
  ## 0.17 2019-05-24
381
405
 
382
- * Implement IO#read_watcher, IO#write_watcher in C for better performance
383
- * Implement nonblocking (yielding) versions of Kernel#system, IO.popen,
406
+ - Implement IO#read_watcher, IO#write_watcher in C for better performance
407
+ - Implement nonblocking (yielding) versions of Kernel#system, IO.popen,
384
408
  Process.detach, IO#gets IO#puts, other IO singleton methods
385
- * Add Coprocess#join as alias to Coprocess#await
386
- * Rename Kernel#spawn to Kernel#coproc
387
- * Fix encoding of strings read with IO#read, IO#readpartial
388
- * Fix non-blocking behaviour of IO#read, IO#readpartial, IO#write
409
+ - Add Coprocess#join as alias to Coprocess#await
410
+ - Rename Kernel#spawn to Kernel#coproc
411
+ - Fix encoding of strings read with IO#read, IO#readpartial
412
+ - Fix non-blocking behaviour of IO#read, IO#readpartial, IO#write
389
413
 
390
414
  ## 0.16 2019-05-22
391
415
 
392
- * Reorganize and refactor code
393
- * Allow opening secure socket without OpenSSL context
416
+ - Reorganize and refactor code
417
+ - Allow opening secure socket without OpenSSL context
394
418
 
395
419
  ## 0.15 2019-05-20
396
420
 
397
- * Optimize `#next_tick` callback (about 6% faster than before)
398
- * Fix IO#<< to return self
399
- * Refactor HTTP code and examples
400
- * Fix race condition in `Supervisor#stop!`
401
- * Add `Kernel#snooze` method (`EV.snooze` will be deprecated eventually)
421
+ - Optimize `#next_tick` callback (about 6% faster than before)
422
+ - Fix IO#<< to return self
423
+ - Refactor HTTP code and examples
424
+ - Fix race condition in `Supervisor#stop!`
425
+ - Add `Kernel#snooze` method (`EV.snooze` will be deprecated eventually)
402
426
 
403
427
  ## 0.14 2019-05-17
404
428
 
405
- * Use chunked encoding in HTTP 1 response
406
- * Rewrite `IO#read`, `#readpartial`, `#write` in C (about 30% performance improvement)
407
- * Add method delegation to `ResourcePool`
408
- * Optimize PG::Connection#async_exec
409
- * Fix `Coprocess#cancel!`
410
- * Preliminary support for websocket (see `examples/io/http_ws_server.rb`)
411
- * Rename `Coroutine` to `Coprocess`
429
+ - Use chunked encoding in HTTP 1 response
430
+ - Rewrite `IO#read`, `#readpartial`, `#write` in C (about 30% performance improvement)
431
+ - Add method delegation to `ResourcePool`
432
+ - Optimize PG::Connection#async_exec
433
+ - Fix `Coprocess#cancel!`
434
+ - Preliminary support for websocket (see `examples/io/http_ws_server.rb`)
435
+ - Rename `Coroutine` to `Coprocess`
412
436
 
413
437
  ## 0.13 2019-01-05
414
438
 
415
- * Rename Rubato to Polyphony (I know, this is getting silly...)
439
+ - Rename Rubato to Polyphony (I know, this is getting silly...)
416
440
 
417
441
  ## 0.12 2019-01-01
418
442
 
419
- * Add Coroutine#resume
420
- * Improve startup time
421
- * Accept rate: or interval: arguments for throttle
422
- * Set correct backtrace for errors
423
- * Improve handling of uncaught raised errors
424
- * Implement HTTP 1.1/2 client agent with connection management
443
+ - Add Coroutine#resume
444
+ - Improve startup time
445
+ - Accept rate: or interval: arguments for throttle
446
+ - Set correct backtrace for errors
447
+ - Improve handling of uncaught raised errors
448
+ - Implement HTTP 1.1/2 client agent with connection management
425
449
 
426
450
  ## 0.11 2018-12-27
427
451
 
428
- * Move reactor loop to secondary fiber, allow blocking operations on main
452
+ - Move reactor loop to secondary fiber, allow blocking operations on main
429
453
  fiber.
430
- * Example implementation of erlang-style generic server pattern (implement async
454
+ - Example implementation of erlang-style generic server pattern (implement async
431
455
  API to a coroutine)
432
- * Implement coroutine mailboxes, Coroutine#<<, Coroutine#receive, Kernel.receive
456
+ - Implement coroutine mailboxes, Coroutine#<<, Coroutine#receive, Kernel.receive
433
457
  for message passing
434
- * Add Coroutine.current for getting current coroutine
458
+ - Add Coroutine.current for getting current coroutine
435
459
 
436
460
  ## 0.10 2018-11-20
437
461
 
438
- * Rewrite Rubato core for simpler code and better performance
439
- * Implement EV.snooze (sleep until next tick)
440
- * Coroutine encapsulates a task spawned on a separate fiber
441
- * Supervisor supervises multiple coroutines
442
- * CancelScope used to cancel an ongoing task (usually with a timeout)
443
- * Rate throttling
444
- * Implement async SSL server
462
+ - Rewrite Rubato core for simpler code and better performance
463
+ - Implement EV.snooze (sleep until next tick)
464
+ - Coroutine encapsulates a task spawned on a separate fiber
465
+ - Supervisor supervises multiple coroutines
466
+ - CancelScope used to cancel an ongoing task (usually with a timeout)
467
+ - Rate throttling
468
+ - Implement async SSL server
445
469
 
446
470
  ## 0.9 2018-11-14
447
471
 
448
- * Rename Nuclear to Rubato
472
+ - Rename Nuclear to Rubato
449
473
 
450
474
  ## 0.8 2018-10-04
451
475
 
452
- * Replace nio4r with in-house extension based on libev, with better API,
476
+ - Replace nio4r with in-house extension based on libev, with better API,
453
477
  better performance, support for IO, timer, signal and async watchers
454
- * Fix mem leak coming from nio4r (probably related to code in Selector#select)
478
+ - Fix mem leak coming from nio4r (probably related to code in Selector#select)
455
479
 
456
480
  ## 0.7 2018-09-13
457
481
 
458
- * Implement resource pool
459
- * transaction method for pg cient
460
- * Async connect for pg client
461
- * Add testing module for testing async code
462
- * Improve HTTP server performance
463
- * Proper promise chaining
482
+ - Implement resource pool
483
+ - transaction method for pg cient
484
+ - Async connect for pg client
485
+ - Add testing module for testing async code
486
+ - Improve HTTP server performance
487
+ - Proper promise chaining
464
488
 
465
489
  ## 0.6 2018-09-11
466
490
 
467
- * Add http, redis, pg dependencies
468
- * Move ALPN code inside net module
491
+ - Add http, redis, pg dependencies
492
+ - Move ALPN code inside net module
469
493
 
470
494
  ## 0.4 2018-09-10
471
495
 
472
- * Code refactored and reogranized
473
- * Fix recursion in next_tick
474
- * HTTP 2 server with support for ALPN protocol negotiation and HTTP upgrade
475
- * OpenSSL server
496
+ - Code refactored and reogranized
497
+ - Fix recursion in next_tick
498
+ - HTTP 2 server with support for ALPN protocol negotiation and HTTP upgrade
499
+ - OpenSSL server
476
500
 
477
501
  ## 0.3 2018-09-06
478
502
 
479
- * Event reactor
480
- * Timers
481
- * Promises
482
- * async/await syntax for promises
483
- * IO and read/write stream
484
- * TCP server/client
485
- * Promised threads
486
- * HTTP server
487
- * Redis interface
488
- * PostgreSQL interface
503
+ - Event reactor
504
+ - Timers
505
+ - Promises
506
+ - async/await syntax for promises
507
+ - IO and read/write stream
508
+ - TCP server/client
509
+ - Promised threads
510
+ - HTTP server
511
+ - Redis interface
512
+ - PostgreSQL interface