polyphony 0.45.0 → 0.45.1
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +9 -1
- data/TODO.md +6 -7
- data/examples/adapters/redis_client.rb +3 -1
- data/examples/adapters/redis_pubsub_perf.rb +11 -8
- data/examples/adapters/sequel_mysql.rb +1 -1
- data/examples/adapters/sequel_pg.rb +24 -0
- data/examples/core/{02-awaiting-fibers.rb → await.rb} +0 -0
- data/examples/core/{xx-channels.rb → channels.rb} +0 -0
- data/examples/core/deferring-an-operation.rb +16 -0
- data/examples/core/{xx-erlang-style-genserver.rb → erlang-style-genserver.rb} +16 -9
- data/examples/core/{xx-forking.rb → forking.rb} +1 -1
- data/examples/core/handling-signals.rb +11 -0
- data/examples/core/{03-interrupting.rb → interrupt.rb} +0 -0
- data/examples/core/{xx-pingpong.rb → pingpong.rb} +7 -5
- data/examples/core/{xx-recurrent-timer.rb → recurrent-timer.rb} +1 -1
- data/examples/core/{xx-resource_delegate.rb → resource_delegate.rb} +3 -4
- data/examples/core/{01-spinning-up-fibers.rb → spin.rb} +1 -1
- data/examples/core/{xx-spin_error_backtrace.rb → spin_error_backtrace.rb} +1 -1
- data/examples/core/{xx-supervise-process.rb → supervise-process.rb} +8 -5
- data/examples/core/supervisor.rb +20 -0
- data/examples/core/{xx-thread-sleep.rb → thread-sleep.rb} +0 -0
- data/examples/core/{xx-thread_pool.rb → thread_pool.rb} +0 -0
- data/examples/core/{xx-throttling.rb → throttling.rb} +0 -0
- data/examples/core/{xx-timeout.rb → timeout.rb} +0 -0
- data/examples/core/{xx-using-a-mutex.rb → using-a-mutex.rb} +0 -0
- data/examples/core/{xx-worker-thread.rb → worker-thread.rb} +2 -2
- data/examples/io/{xx-backticks.rb → backticks.rb} +0 -0
- data/examples/io/{xx-echo_client.rb → echo_client.rb} +1 -1
- data/examples/io/{xx-echo_client_from_stdin.rb → echo_client_from_stdin.rb} +2 -2
- data/examples/io/{xx-echo_pipe.rb → echo_pipe.rb} +1 -1
- data/examples/io/{xx-echo_server.rb → echo_server.rb} +0 -0
- data/examples/io/{xx-echo_server_with_timeout.rb → echo_server_with_timeout.rb} +1 -1
- data/examples/io/{xx-echo_stdin.rb → echo_stdin.rb} +0 -0
- data/examples/io/{xx-happy-eyeballs.rb → happy-eyeballs.rb} +0 -0
- data/examples/io/{xx-httparty.rb → httparty.rb} +4 -13
- data/examples/io/{xx-irb.rb → irb.rb} +0 -0
- data/examples/io/{xx-net-http.rb → net-http.rb} +0 -0
- data/examples/io/{xx-open.rb → open.rb} +0 -0
- data/examples/io/{xx-pry.rb → pry.rb} +0 -0
- data/examples/io/{xx-rack_server.rb → rack_server.rb} +0 -0
- data/examples/io/{xx-system.rb → system.rb} +1 -1
- data/examples/io/{xx-tcpserver.rb → tcpserver.rb} +0 -0
- data/examples/io/{xx-tcpsocket.rb → tcpsocket.rb} +0 -0
- data/examples/io/tunnel.rb +6 -1
- data/examples/io/{xx-zip.rb → zip.rb} +0 -0
- data/examples/performance/fiber_transfer.rb +2 -1
- data/examples/performance/fs_read.rb +5 -6
- data/examples/{io/xx-switch.rb → performance/switch.rb} +2 -1
- data/examples/performance/thread-vs-fiber/{xx-httparty_multi.rb → httparty_multi.rb} +3 -4
- data/examples/performance/thread-vs-fiber/{xx-httparty_threaded.rb → httparty_threaded.rb} +0 -0
- data/examples/performance/thread-vs-fiber/polyphony_mt_server.rb +1 -1
- data/examples/performance/thread-vs-fiber/polyphony_server.rb +1 -1
- data/examples/performance/thread-vs-fiber/threaded_server.rb +1 -5
- data/examples/performance/thread_pool_perf.rb +6 -7
- data/ext/polyphony/backend.h +0 -1
- data/ext/polyphony/libev_backend.c +69 -68
- data/ext/polyphony/polyphony.c +0 -2
- data/ext/polyphony/polyphony.h +0 -13
- data/ext/polyphony/polyphony_ext.c +1 -2
- data/ext/polyphony/queue.c +3 -4
- data/ext/polyphony/ring_buffer.c +0 -1
- data/ext/polyphony/thread.c +3 -4
- data/lib/polyphony/adapters/fs.rb +1 -1
- data/lib/polyphony/adapters/redis.rb +1 -1
- data/lib/polyphony/core/global_api.rb +4 -4
- data/lib/polyphony/core/sync.rb +11 -9
- data/lib/polyphony/extensions/core.rb +1 -6
- data/lib/polyphony/extensions/io.rb +40 -6
- data/lib/polyphony/extensions/socket.rb +11 -2
- data/lib/polyphony/version.rb +1 -1
- data/polyphony.gemspec +2 -1
- data/test/test_io.rb +16 -0
- data/test/test_socket.rb +17 -0
- data/test/test_throttler.rb +1 -0
- metadata +58 -72
- data/examples/adapters/concurrent-ruby.rb +0 -9
- data/examples/core/04-handling-signals.rb +0 -19
- data/examples/core/xx-at_exit.rb +0 -29
- data/examples/core/xx-backend.rb +0 -102
- data/examples/core/xx-caller.rb +0 -12
- data/examples/core/xx-daemon.rb +0 -14
- data/examples/core/xx-deadlock.rb +0 -8
- data/examples/core/xx-deferring-an-operation.rb +0 -14
- data/examples/core/xx-exception-backtrace.rb +0 -40
- data/examples/core/xx-fork-cleanup.rb +0 -22
- data/examples/core/xx-fork-spin.rb +0 -42
- data/examples/core/xx-fork-terminate.rb +0 -27
- data/examples/core/xx-move_on.rb +0 -23
- data/examples/core/xx-queue-async.rb +0 -120
- data/examples/core/xx-readpartial.rb +0 -18
- data/examples/core/xx-signals.rb +0 -16
- data/examples/core/xx-sleep-forever.rb +0 -9
- data/examples/core/xx-sleeping.rb +0 -25
- data/examples/core/xx-snooze-starve.rb +0 -16
- data/examples/core/xx-spin-fork.rb +0 -49
- data/examples/core/xx-state-machine.rb +0 -51
- data/examples/core/xx-stop.rb +0 -20
- data/examples/core/xx-supervisors.rb +0 -21
- data/examples/core/xx-thread-selector-sleep.rb +0 -51
- data/examples/core/xx-thread-selector-snooze.rb +0 -46
- data/examples/core/xx-thread-snooze.rb +0 -34
- data/examples/core/xx-timer-gc.rb +0 -17
- data/examples/core/xx-trace.rb +0 -79
- data/examples/performance/xx-array.rb +0 -11
- data/examples/performance/xx-fiber-switch.rb +0 -9
- data/examples/performance/xx-snooze.rb +0 -15
- data/examples/xx-spin.rb +0 -32
data/ext/polyphony/polyphony.c
CHANGED
|
@@ -9,7 +9,6 @@ ID ID_each;
|
|
|
9
9
|
ID ID_inspect;
|
|
10
10
|
ID ID_invoke;
|
|
11
11
|
ID ID_new;
|
|
12
|
-
ID ID_raise;
|
|
13
12
|
ID ID_ivar_running;
|
|
14
13
|
ID ID_ivar_thread;
|
|
15
14
|
ID ID_runnable;
|
|
@@ -65,7 +64,6 @@ void Init_Polyphony() {
|
|
|
65
64
|
ID_ivar_running = rb_intern("@running");
|
|
66
65
|
ID_ivar_thread = rb_intern("@thread");
|
|
67
66
|
ID_new = rb_intern("new");
|
|
68
|
-
ID_raise = rb_intern("raise");
|
|
69
67
|
ID_runnable = rb_intern("runnable");
|
|
70
68
|
ID_runnable_value = rb_intern("runnable_value");
|
|
71
69
|
ID_signal = rb_intern("signal");
|
data/ext/polyphony/polyphony.h
CHANGED
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
return RAISE_EXCEPTION(ret); \
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
27
|
extern backend_interface_t backend_interface;
|
|
29
28
|
#define __BACKEND__ (backend_interface)
|
|
30
29
|
|
|
@@ -67,12 +66,6 @@ enum {
|
|
|
67
66
|
FIBER_STATE_SCHEDULED = 2
|
|
68
67
|
};
|
|
69
68
|
|
|
70
|
-
// watcher flags
|
|
71
|
-
enum {
|
|
72
|
-
// a watcher's active field will be set to this after fork
|
|
73
|
-
GYRO_WATCHER_POST_FORK = 0xFF
|
|
74
|
-
};
|
|
75
|
-
|
|
76
69
|
VALUE Fiber_auto_watcher(VALUE self);
|
|
77
70
|
void Fiber_make_runnable(VALUE fiber, VALUE value);
|
|
78
71
|
|
|
@@ -85,13 +78,7 @@ VALUE Queue_delete(VALUE self, VALUE value);
|
|
|
85
78
|
long Queue_len(VALUE self);
|
|
86
79
|
void Queue_trace(VALUE self);
|
|
87
80
|
|
|
88
|
-
VALUE Polyphony_snooze(VALUE self);
|
|
89
|
-
|
|
90
81
|
VALUE Thread_schedule_fiber(VALUE thread, VALUE fiber, VALUE value);
|
|
91
82
|
VALUE Thread_switch_fiber(VALUE thread);
|
|
92
83
|
|
|
93
|
-
int io_setstrbuf(VALUE *str, long len);
|
|
94
|
-
void io_set_read_length(VALUE str, long n, int shrinkable);
|
|
95
|
-
VALUE io_enc_str(VALUE str, rb_io_t *fptr);
|
|
96
|
-
|
|
97
84
|
#endif /* POLYPHONY_H */
|
data/ext/polyphony/queue.c
CHANGED
|
@@ -85,12 +85,11 @@ VALUE Queue_shift(VALUE self) {
|
|
|
85
85
|
while (1) {
|
|
86
86
|
ring_buffer_push(&queue->shift_queue, fiber);
|
|
87
87
|
if (queue->values.count > 0) Fiber_make_runnable(fiber, Qnil);
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
VALUE switchpoint_result = __BACKEND__.wait_event(backend, Qnil);
|
|
90
90
|
ring_buffer_delete(&queue->shift_queue, fiber);
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
return rb_funcall(rb_mKernel, ID_raise, 1, switchpoint_result);
|
|
92
|
+
TEST_RESUME_EXCEPTION(switchpoint_result);
|
|
94
93
|
RB_GC_GUARD(switchpoint_result);
|
|
95
94
|
|
|
96
95
|
if (queue->values.count > 0)
|
|
@@ -152,7 +151,7 @@ VALUE Queue_flush_waiters(VALUE self, VALUE value) {
|
|
|
152
151
|
while(1) {
|
|
153
152
|
VALUE fiber = ring_buffer_shift(&queue->shift_queue);
|
|
154
153
|
if (fiber == Qnil) return self;
|
|
155
|
-
|
|
154
|
+
|
|
156
155
|
Fiber_make_runnable(fiber, value);
|
|
157
156
|
}
|
|
158
157
|
}
|
data/ext/polyphony/ring_buffer.c
CHANGED
data/ext/polyphony/thread.c
CHANGED
|
@@ -12,7 +12,7 @@ ID ID_stop;
|
|
|
12
12
|
|
|
13
13
|
static VALUE Thread_setup_fiber_scheduling(VALUE self) {
|
|
14
14
|
VALUE queue = rb_funcall(cQueue, ID_new, 0);
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
rb_ivar_set(self, ID_ivar_main_fiber, rb_fiber_current());
|
|
17
17
|
rb_ivar_set(self, ID_run_queue, queue);
|
|
18
18
|
|
|
@@ -133,8 +133,7 @@ VALUE Thread_switch_fiber(VALUE self) {
|
|
|
133
133
|
next_fiber = Queue_shift_no_wait(queue);
|
|
134
134
|
if (next_fiber != Qnil) {
|
|
135
135
|
if (backend_was_polled == 0 && ref_count > 0) {
|
|
136
|
-
// this
|
|
137
|
-
// empties
|
|
136
|
+
// this prevents event starvation in case the run queue never empties
|
|
138
137
|
__BACKEND__.poll(backend, Qtrue, current_fiber, queue);
|
|
139
138
|
}
|
|
140
139
|
break;
|
|
@@ -154,7 +153,7 @@ VALUE Thread_switch_fiber(VALUE self) {
|
|
|
154
153
|
rb_ivar_set(next_fiber, ID_runnable, Qnil);
|
|
155
154
|
RB_GC_GUARD(next_fiber);
|
|
156
155
|
RB_GC_GUARD(value);
|
|
157
|
-
return (next_fiber == current_fiber) ?
|
|
156
|
+
return (next_fiber == current_fiber) ?
|
|
158
157
|
value : rb_funcall(next_fiber, ID_transfer, 1, value);
|
|
159
158
|
}
|
|
160
159
|
|
|
@@ -113,10 +113,10 @@ module Polyphony
|
|
|
113
113
|
Thread.current.backend.unref
|
|
114
114
|
end
|
|
115
115
|
|
|
116
|
-
def throttled_loop(rate
|
|
117
|
-
throttler = Polyphony::Throttler.new(rate)
|
|
118
|
-
if count
|
|
119
|
-
count.times { |_i| throttler.(&block) }
|
|
116
|
+
def throttled_loop(rate = nil, **opts, &block)
|
|
117
|
+
throttler = Polyphony::Throttler.new(rate || opts)
|
|
118
|
+
if opts[:count]
|
|
119
|
+
opts[:count].times { |_i| throttler.(&block) }
|
|
120
120
|
else
|
|
121
121
|
loop { throttler.(&block) }
|
|
122
122
|
end
|
data/lib/polyphony/core/sync.rb
CHANGED
|
@@ -8,17 +8,19 @@ module Polyphony
|
|
|
8
8
|
@store << :token
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def synchronize
|
|
11
|
+
def synchronize(&block)
|
|
12
12
|
return yield if @holding_fiber == Fiber.current
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
synchronize_not_holding(&block)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def synchronize_not_holding
|
|
18
|
+
@token = @store.shift
|
|
19
|
+
@holding_fiber = Fiber.current
|
|
20
|
+
yield
|
|
21
|
+
ensure
|
|
22
|
+
@holding_fiber = nil
|
|
23
|
+
@store << @token if @token
|
|
22
24
|
end
|
|
23
25
|
|
|
24
26
|
def conditional_release
|
|
@@ -141,12 +141,7 @@ module ::Kernel
|
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
def pipe_to_eof(src, dest)
|
|
144
|
-
|
|
145
|
-
data = src.readpartial(8192)
|
|
146
|
-
dest << data
|
|
147
|
-
rescue EOFError
|
|
148
|
-
break
|
|
149
|
-
end
|
|
144
|
+
src.read_loop { |data| dest << data }
|
|
150
145
|
end
|
|
151
146
|
|
|
152
147
|
alias_method :orig_trap, :trap
|
|
@@ -163,19 +163,29 @@ class ::IO
|
|
|
163
163
|
# def putc(obj)
|
|
164
164
|
# end
|
|
165
165
|
|
|
166
|
+
LINEFEED = "\n"
|
|
167
|
+
LINEFEED_RE = /\n$/.freeze
|
|
168
|
+
|
|
166
169
|
alias_method :orig_puts, :puts
|
|
167
170
|
def puts(*args)
|
|
168
171
|
if args.empty?
|
|
169
|
-
write
|
|
172
|
+
write LINEFEED
|
|
170
173
|
return
|
|
171
174
|
end
|
|
172
175
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
idx = 0
|
|
177
|
+
while idx < args.size
|
|
178
|
+
arg = args[idx]
|
|
179
|
+
args[idx] = arg = arg.to_s unless arg.is_a?(String)
|
|
180
|
+
if arg =~ LINEFEED_RE
|
|
181
|
+
idx += 1
|
|
182
|
+
else
|
|
183
|
+
args.insert(idx + 1, LINEFEED)
|
|
184
|
+
idx += 2
|
|
185
|
+
end
|
|
177
186
|
end
|
|
178
|
-
|
|
187
|
+
|
|
188
|
+
write(*args)
|
|
179
189
|
nil
|
|
180
190
|
end
|
|
181
191
|
|
|
@@ -217,4 +227,28 @@ class ::IO
|
|
|
217
227
|
# end
|
|
218
228
|
# outbuf
|
|
219
229
|
# end
|
|
230
|
+
|
|
231
|
+
def wait_readable(timeout = nil)
|
|
232
|
+
if timeout
|
|
233
|
+
move_on_after(timeout) do
|
|
234
|
+
Thread.current.backend.wait_io(self, false)
|
|
235
|
+
self
|
|
236
|
+
end
|
|
237
|
+
else
|
|
238
|
+
Thread.current.backend.wait_io(self, false)
|
|
239
|
+
self
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
def wait_writable(timeout = nil)
|
|
244
|
+
if timeout
|
|
245
|
+
move_on_after(timeout) do
|
|
246
|
+
Thread.current.backend.wait_io(self, true)
|
|
247
|
+
self
|
|
248
|
+
end
|
|
249
|
+
else
|
|
250
|
+
Thread.current.backend.wait_io(self, true)
|
|
251
|
+
self
|
|
252
|
+
end
|
|
253
|
+
end
|
|
220
254
|
end
|
|
@@ -13,8 +13,9 @@ class ::Socket
|
|
|
13
13
|
|
|
14
14
|
NO_EXCEPTION = { exception: false }.freeze
|
|
15
15
|
|
|
16
|
-
def connect(
|
|
17
|
-
|
|
16
|
+
def connect(addr)
|
|
17
|
+
addr = Addrinfo.new(addr) if addr.is_a?(String)
|
|
18
|
+
Thread.current.backend.connect(self, addr.ip_address, addr.ip_port)
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
def recv(maxlen, flags = 0, outbuf = nil)
|
|
@@ -118,6 +119,14 @@ class ::TCPSocket
|
|
|
118
119
|
def reuse_port
|
|
119
120
|
setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_REUSEPORT, 1)
|
|
120
121
|
end
|
|
122
|
+
|
|
123
|
+
def read_nonblock(len, str = nil, exception: true)
|
|
124
|
+
@io.read_nonblock(len, str, exception: exception)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def write_nonblock(buf, exception: true)
|
|
128
|
+
@io.write_nonblock(buf, exception: exception)
|
|
129
|
+
end
|
|
121
130
|
end
|
|
122
131
|
|
|
123
132
|
# Override stock TCPServer code by encapsulating a Socket instance.
|
data/lib/polyphony/version.rb
CHANGED
data/polyphony.gemspec
CHANGED
|
@@ -32,9 +32,10 @@ Gem::Specification.new do |s|
|
|
|
32
32
|
s.add_development_dependency 'redis', '4.1.0'
|
|
33
33
|
s.add_development_dependency 'hiredis', '0.6.3'
|
|
34
34
|
s.add_development_dependency 'http_parser.rb', '~>0.6.0'
|
|
35
|
-
s.add_development_dependency 'rack',
|
|
35
|
+
s.add_development_dependency 'rack', '>=2.0.8', '<2.3.0'
|
|
36
36
|
s.add_development_dependency 'mysql2', '0.5.3'
|
|
37
37
|
s.add_development_dependency 'sequel', '5.34.0'
|
|
38
|
+
s.add_development_dependency 'httparty', '0.17.1'
|
|
38
39
|
|
|
39
40
|
s.add_development_dependency 'jekyll', '~>3.8.6'
|
|
40
41
|
s.add_development_dependency 'jekyll-remote-theme', '~>0.4.1'
|
data/test/test_io.rb
CHANGED
|
@@ -246,4 +246,20 @@ class IOClassMethodsTest < MiniTest::Test
|
|
|
246
246
|
assert_equal 1e6, s.bytesize
|
|
247
247
|
assert s == IO.orig_read(fn)
|
|
248
248
|
end
|
|
249
|
+
|
|
250
|
+
def pipe_read
|
|
251
|
+
i, o = IO.pipe
|
|
252
|
+
yield o
|
|
253
|
+
o.close
|
|
254
|
+
i.read
|
|
255
|
+
ensure
|
|
256
|
+
i.close
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
def test_puts
|
|
260
|
+
assert_equal "foo\n", pipe_read { |f| f.puts 'foo' }
|
|
261
|
+
assert_equal "foo\n", pipe_read { |f| f.puts "foo\n" }
|
|
262
|
+
assert_equal "foo\nbar\n", pipe_read { |f| f.puts 'foo', 'bar' }
|
|
263
|
+
assert_equal "foo\nbar\n", pipe_read { |f| f.puts 'foo', "bar\n" }
|
|
264
|
+
end
|
|
249
265
|
end
|
data/test/test_socket.rb
CHANGED
|
@@ -32,3 +32,20 @@ class SocketTest < MiniTest::Test
|
|
|
32
32
|
server&.close
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
|
+
|
|
36
|
+
class HTTPClientTest < MiniTest::Test
|
|
37
|
+
require 'httparty'
|
|
38
|
+
require 'json'
|
|
39
|
+
|
|
40
|
+
def test_http
|
|
41
|
+
res = HTTParty.get('http://worldtimeapi.org/api/timezone/Europe/Paris')
|
|
42
|
+
response = JSON.load(res.body)
|
|
43
|
+
assert_equal "CEST", response['abbreviation']
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def test_https
|
|
47
|
+
res = HTTParty.get('https://worldtimeapi.org/api/timezone/Europe/Paris')
|
|
48
|
+
response = JSON.load(res.body)
|
|
49
|
+
assert_equal "CEST", response['abbreviation']
|
|
50
|
+
end
|
|
51
|
+
end
|
data/test/test_throttler.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: polyphony
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.45.
|
|
4
|
+
version: 0.45.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sharon Rosner
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-08-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake-compiler
|
|
@@ -198,6 +198,20 @@ dependencies:
|
|
|
198
198
|
- - '='
|
|
199
199
|
- !ruby/object:Gem::Version
|
|
200
200
|
version: 5.34.0
|
|
201
|
+
- !ruby/object:Gem::Dependency
|
|
202
|
+
name: httparty
|
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
|
204
|
+
requirements:
|
|
205
|
+
- - '='
|
|
206
|
+
- !ruby/object:Gem::Version
|
|
207
|
+
version: 0.17.1
|
|
208
|
+
type: :development
|
|
209
|
+
prerelease: false
|
|
210
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
211
|
+
requirements:
|
|
212
|
+
- - '='
|
|
213
|
+
- !ruby/object:Gem::Version
|
|
214
|
+
version: 0.17.1
|
|
201
215
|
- !ruby/object:Gem::Dependency
|
|
202
216
|
name: jekyll
|
|
203
217
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -317,7 +331,6 @@ files:
|
|
|
317
331
|
- docs/main-concepts/fiber-scheduling.md
|
|
318
332
|
- docs/main-concepts/index.md
|
|
319
333
|
- docs/polyphony-logo.png
|
|
320
|
-
- examples/adapters/concurrent-ruby.rb
|
|
321
334
|
- examples/adapters/pg_client.rb
|
|
322
335
|
- examples/adapters/pg_notify.rb
|
|
323
336
|
- examples/adapters/pg_pool.rb
|
|
@@ -329,70 +342,46 @@ files:
|
|
|
329
342
|
- examples/adapters/redis_pubsub_perf.rb
|
|
330
343
|
- examples/adapters/sequel_mysql.rb
|
|
331
344
|
- examples/adapters/sequel_mysql_pool.rb
|
|
332
|
-
- examples/
|
|
333
|
-
- examples/core/
|
|
334
|
-
- examples/core/
|
|
335
|
-
- examples/core/
|
|
336
|
-
- examples/core/
|
|
337
|
-
- examples/core/
|
|
338
|
-
- examples/core/
|
|
339
|
-
- examples/core/
|
|
340
|
-
- examples/core/
|
|
341
|
-
- examples/core/
|
|
342
|
-
- examples/core/
|
|
343
|
-
- examples/core/
|
|
344
|
-
- examples/core/
|
|
345
|
-
- examples/core/
|
|
346
|
-
- examples/core/
|
|
347
|
-
- examples/core/
|
|
348
|
-
- examples/core/
|
|
349
|
-
- examples/core/
|
|
350
|
-
- examples/core/
|
|
351
|
-
- examples/core/
|
|
352
|
-
- examples/core/
|
|
353
|
-
- examples/
|
|
354
|
-
- examples/
|
|
355
|
-
- examples/
|
|
356
|
-
- examples/
|
|
357
|
-
- examples/
|
|
358
|
-
- examples/
|
|
359
|
-
- examples/
|
|
360
|
-
- examples/
|
|
361
|
-
- examples/
|
|
362
|
-
- examples/
|
|
363
|
-
- examples/
|
|
364
|
-
- examples/
|
|
365
|
-
- examples/
|
|
366
|
-
- examples/
|
|
367
|
-
- examples/
|
|
368
|
-
- examples/
|
|
369
|
-
- examples/
|
|
370
|
-
- examples/core/xx-throttling.rb
|
|
371
|
-
- examples/core/xx-timeout.rb
|
|
372
|
-
- examples/core/xx-timer-gc.rb
|
|
373
|
-
- examples/core/xx-trace.rb
|
|
374
|
-
- examples/core/xx-using-a-mutex.rb
|
|
375
|
-
- examples/core/xx-worker-thread.rb
|
|
345
|
+
- examples/adapters/sequel_pg.rb
|
|
346
|
+
- examples/core/await.rb
|
|
347
|
+
- examples/core/channels.rb
|
|
348
|
+
- examples/core/deferring-an-operation.rb
|
|
349
|
+
- examples/core/erlang-style-genserver.rb
|
|
350
|
+
- examples/core/forking.rb
|
|
351
|
+
- examples/core/handling-signals.rb
|
|
352
|
+
- examples/core/interrupt.rb
|
|
353
|
+
- examples/core/pingpong.rb
|
|
354
|
+
- examples/core/recurrent-timer.rb
|
|
355
|
+
- examples/core/resource_delegate.rb
|
|
356
|
+
- examples/core/spin.rb
|
|
357
|
+
- examples/core/spin_error_backtrace.rb
|
|
358
|
+
- examples/core/supervise-process.rb
|
|
359
|
+
- examples/core/supervisor.rb
|
|
360
|
+
- examples/core/thread-sleep.rb
|
|
361
|
+
- examples/core/thread_pool.rb
|
|
362
|
+
- examples/core/throttling.rb
|
|
363
|
+
- examples/core/timeout.rb
|
|
364
|
+
- examples/core/using-a-mutex.rb
|
|
365
|
+
- examples/core/worker-thread.rb
|
|
366
|
+
- examples/io/backticks.rb
|
|
367
|
+
- examples/io/echo_client.rb
|
|
368
|
+
- examples/io/echo_client_from_stdin.rb
|
|
369
|
+
- examples/io/echo_pipe.rb
|
|
370
|
+
- examples/io/echo_server.rb
|
|
371
|
+
- examples/io/echo_server_with_timeout.rb
|
|
372
|
+
- examples/io/echo_stdin.rb
|
|
373
|
+
- examples/io/happy-eyeballs.rb
|
|
374
|
+
- examples/io/httparty.rb
|
|
375
|
+
- examples/io/irb.rb
|
|
376
|
+
- examples/io/net-http.rb
|
|
377
|
+
- examples/io/open.rb
|
|
378
|
+
- examples/io/pry.rb
|
|
379
|
+
- examples/io/rack_server.rb
|
|
380
|
+
- examples/io/system.rb
|
|
381
|
+
- examples/io/tcpserver.rb
|
|
382
|
+
- examples/io/tcpsocket.rb
|
|
376
383
|
- examples/io/tunnel.rb
|
|
377
|
-
- examples/io/
|
|
378
|
-
- examples/io/xx-echo_client.rb
|
|
379
|
-
- examples/io/xx-echo_client_from_stdin.rb
|
|
380
|
-
- examples/io/xx-echo_pipe.rb
|
|
381
|
-
- examples/io/xx-echo_server.rb
|
|
382
|
-
- examples/io/xx-echo_server_with_timeout.rb
|
|
383
|
-
- examples/io/xx-echo_stdin.rb
|
|
384
|
-
- examples/io/xx-happy-eyeballs.rb
|
|
385
|
-
- examples/io/xx-httparty.rb
|
|
386
|
-
- examples/io/xx-irb.rb
|
|
387
|
-
- examples/io/xx-net-http.rb
|
|
388
|
-
- examples/io/xx-open.rb
|
|
389
|
-
- examples/io/xx-pry.rb
|
|
390
|
-
- examples/io/xx-rack_server.rb
|
|
391
|
-
- examples/io/xx-switch.rb
|
|
392
|
-
- examples/io/xx-system.rb
|
|
393
|
-
- examples/io/xx-tcpserver.rb
|
|
394
|
-
- examples/io/xx-tcpsocket.rb
|
|
395
|
-
- examples/io/xx-zip.rb
|
|
384
|
+
- examples/io/zip.rb
|
|
396
385
|
- examples/performance/fiber_transfer.rb
|
|
397
386
|
- examples/performance/fs_read.rb
|
|
398
387
|
- examples/performance/mem-usage.rb
|
|
@@ -400,17 +389,14 @@ files:
|
|
|
400
389
|
- examples/performance/multi_snooze.rb
|
|
401
390
|
- examples/performance/snooze.rb
|
|
402
391
|
- examples/performance/snooze_raw.rb
|
|
392
|
+
- examples/performance/switch.rb
|
|
393
|
+
- examples/performance/thread-vs-fiber/httparty_multi.rb
|
|
394
|
+
- examples/performance/thread-vs-fiber/httparty_threaded.rb
|
|
403
395
|
- examples/performance/thread-vs-fiber/polyphony_mt_server.rb
|
|
404
396
|
- examples/performance/thread-vs-fiber/polyphony_server.rb
|
|
405
397
|
- examples/performance/thread-vs-fiber/polyphony_server_read_loop.rb
|
|
406
398
|
- examples/performance/thread-vs-fiber/threaded_server.rb
|
|
407
|
-
- examples/performance/thread-vs-fiber/xx-httparty_multi.rb
|
|
408
|
-
- examples/performance/thread-vs-fiber/xx-httparty_threaded.rb
|
|
409
399
|
- examples/performance/thread_pool_perf.rb
|
|
410
|
-
- examples/performance/xx-array.rb
|
|
411
|
-
- examples/performance/xx-fiber-switch.rb
|
|
412
|
-
- examples/performance/xx-snooze.rb
|
|
413
|
-
- examples/xx-spin.rb
|
|
414
400
|
- ext/libev/Changes
|
|
415
401
|
- ext/libev/LICENSE
|
|
416
402
|
- ext/libev/README
|