polyphony 0.47.4 → 0.49.1

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