polyphony 0.47.3 → 0.49.0

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