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.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/CHANGELOG.md +10 -0
  4. data/Gemfile.lock +9 -1
  5. data/TODO.md +6 -7
  6. data/examples/adapters/redis_client.rb +3 -1
  7. data/examples/adapters/redis_pubsub_perf.rb +11 -8
  8. data/examples/adapters/sequel_mysql.rb +1 -1
  9. data/examples/adapters/sequel_pg.rb +24 -0
  10. data/examples/core/{02-awaiting-fibers.rb → await.rb} +0 -0
  11. data/examples/core/{xx-channels.rb → channels.rb} +0 -0
  12. data/examples/core/deferring-an-operation.rb +16 -0
  13. data/examples/core/{xx-erlang-style-genserver.rb → erlang-style-genserver.rb} +16 -9
  14. data/examples/core/{xx-forking.rb → forking.rb} +1 -1
  15. data/examples/core/handling-signals.rb +11 -0
  16. data/examples/core/{03-interrupting.rb → interrupt.rb} +0 -0
  17. data/examples/core/{xx-pingpong.rb → pingpong.rb} +7 -5
  18. data/examples/core/{xx-recurrent-timer.rb → recurrent-timer.rb} +1 -1
  19. data/examples/core/{xx-resource_delegate.rb → resource_delegate.rb} +3 -4
  20. data/examples/core/{01-spinning-up-fibers.rb → spin.rb} +1 -1
  21. data/examples/core/{xx-spin_error_backtrace.rb → spin_error_backtrace.rb} +1 -1
  22. data/examples/core/{xx-supervise-process.rb → supervise-process.rb} +8 -5
  23. data/examples/core/supervisor.rb +20 -0
  24. data/examples/core/{xx-thread-sleep.rb → thread-sleep.rb} +0 -0
  25. data/examples/core/{xx-thread_pool.rb → thread_pool.rb} +0 -0
  26. data/examples/core/{xx-throttling.rb → throttling.rb} +0 -0
  27. data/examples/core/{xx-timeout.rb → timeout.rb} +0 -0
  28. data/examples/core/{xx-using-a-mutex.rb → using-a-mutex.rb} +0 -0
  29. data/examples/core/{xx-worker-thread.rb → worker-thread.rb} +2 -2
  30. data/examples/io/{xx-backticks.rb → backticks.rb} +0 -0
  31. data/examples/io/{xx-echo_client.rb → echo_client.rb} +1 -1
  32. data/examples/io/{xx-echo_client_from_stdin.rb → echo_client_from_stdin.rb} +2 -2
  33. data/examples/io/{xx-echo_pipe.rb → echo_pipe.rb} +1 -1
  34. data/examples/io/{xx-echo_server.rb → echo_server.rb} +0 -0
  35. data/examples/io/{xx-echo_server_with_timeout.rb → echo_server_with_timeout.rb} +1 -1
  36. data/examples/io/{xx-echo_stdin.rb → echo_stdin.rb} +0 -0
  37. data/examples/io/{xx-happy-eyeballs.rb → happy-eyeballs.rb} +0 -0
  38. data/examples/io/{xx-httparty.rb → httparty.rb} +4 -13
  39. data/examples/io/{xx-irb.rb → irb.rb} +0 -0
  40. data/examples/io/{xx-net-http.rb → net-http.rb} +0 -0
  41. data/examples/io/{xx-open.rb → open.rb} +0 -0
  42. data/examples/io/{xx-pry.rb → pry.rb} +0 -0
  43. data/examples/io/{xx-rack_server.rb → rack_server.rb} +0 -0
  44. data/examples/io/{xx-system.rb → system.rb} +1 -1
  45. data/examples/io/{xx-tcpserver.rb → tcpserver.rb} +0 -0
  46. data/examples/io/{xx-tcpsocket.rb → tcpsocket.rb} +0 -0
  47. data/examples/io/tunnel.rb +6 -1
  48. data/examples/io/{xx-zip.rb → zip.rb} +0 -0
  49. data/examples/performance/fiber_transfer.rb +2 -1
  50. data/examples/performance/fs_read.rb +5 -6
  51. data/examples/{io/xx-switch.rb → performance/switch.rb} +2 -1
  52. data/examples/performance/thread-vs-fiber/{xx-httparty_multi.rb → httparty_multi.rb} +3 -4
  53. data/examples/performance/thread-vs-fiber/{xx-httparty_threaded.rb → httparty_threaded.rb} +0 -0
  54. data/examples/performance/thread-vs-fiber/polyphony_mt_server.rb +1 -1
  55. data/examples/performance/thread-vs-fiber/polyphony_server.rb +1 -1
  56. data/examples/performance/thread-vs-fiber/threaded_server.rb +1 -5
  57. data/examples/performance/thread_pool_perf.rb +6 -7
  58. data/ext/polyphony/backend.h +0 -1
  59. data/ext/polyphony/libev_backend.c +69 -68
  60. data/ext/polyphony/polyphony.c +0 -2
  61. data/ext/polyphony/polyphony.h +0 -13
  62. data/ext/polyphony/polyphony_ext.c +1 -2
  63. data/ext/polyphony/queue.c +3 -4
  64. data/ext/polyphony/ring_buffer.c +0 -1
  65. data/ext/polyphony/thread.c +3 -4
  66. data/lib/polyphony/adapters/fs.rb +1 -1
  67. data/lib/polyphony/adapters/redis.rb +1 -1
  68. data/lib/polyphony/core/global_api.rb +4 -4
  69. data/lib/polyphony/core/sync.rb +11 -9
  70. data/lib/polyphony/extensions/core.rb +1 -6
  71. data/lib/polyphony/extensions/io.rb +40 -6
  72. data/lib/polyphony/extensions/socket.rb +11 -2
  73. data/lib/polyphony/version.rb +1 -1
  74. data/polyphony.gemspec +2 -1
  75. data/test/test_io.rb +16 -0
  76. data/test/test_socket.rb +17 -0
  77. data/test/test_throttler.rb +1 -0
  78. metadata +58 -72
  79. data/examples/adapters/concurrent-ruby.rb +0 -9
  80. data/examples/core/04-handling-signals.rb +0 -19
  81. data/examples/core/xx-at_exit.rb +0 -29
  82. data/examples/core/xx-backend.rb +0 -102
  83. data/examples/core/xx-caller.rb +0 -12
  84. data/examples/core/xx-daemon.rb +0 -14
  85. data/examples/core/xx-deadlock.rb +0 -8
  86. data/examples/core/xx-deferring-an-operation.rb +0 -14
  87. data/examples/core/xx-exception-backtrace.rb +0 -40
  88. data/examples/core/xx-fork-cleanup.rb +0 -22
  89. data/examples/core/xx-fork-spin.rb +0 -42
  90. data/examples/core/xx-fork-terminate.rb +0 -27
  91. data/examples/core/xx-move_on.rb +0 -23
  92. data/examples/core/xx-queue-async.rb +0 -120
  93. data/examples/core/xx-readpartial.rb +0 -18
  94. data/examples/core/xx-signals.rb +0 -16
  95. data/examples/core/xx-sleep-forever.rb +0 -9
  96. data/examples/core/xx-sleeping.rb +0 -25
  97. data/examples/core/xx-snooze-starve.rb +0 -16
  98. data/examples/core/xx-spin-fork.rb +0 -49
  99. data/examples/core/xx-state-machine.rb +0 -51
  100. data/examples/core/xx-stop.rb +0 -20
  101. data/examples/core/xx-supervisors.rb +0 -21
  102. data/examples/core/xx-thread-selector-sleep.rb +0 -51
  103. data/examples/core/xx-thread-selector-snooze.rb +0 -46
  104. data/examples/core/xx-thread-snooze.rb +0 -34
  105. data/examples/core/xx-timer-gc.rb +0 -17
  106. data/examples/core/xx-trace.rb +0 -79
  107. data/examples/performance/xx-array.rb +0 -11
  108. data/examples/performance/xx-fiber-switch.rb +0 -9
  109. data/examples/performance/xx-snooze.rb +0 -15
  110. data/examples/xx-spin.rb +0 -32
@@ -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");
@@ -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 */
@@ -12,12 +12,11 @@ void Init_polyphony_ext() {
12
12
  ev_set_allocator(xrealloc);
13
13
 
14
14
  Init_Polyphony();
15
+
15
16
  Init_LibevBackend();
16
17
  Init_Queue();
17
18
  Init_Event();
18
-
19
19
  Init_Fiber();
20
20
  Init_Thread();
21
-
22
21
  Init_Tracing();
23
22
  }
@@ -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
- if (RTEST(rb_obj_is_kind_of(switchpoint_result, rb_eException)))
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
  }
@@ -24,7 +24,6 @@ VALUE ring_buffer_shift(ring_buffer *buffer) {
24
24
  value = buffer->entries[buffer->head];
25
25
  buffer->head = (buffer->head + 1) % buffer->size;
26
26
  buffer->count--;
27
- // INSPECT(value);
28
27
  return value;
29
28
  }
30
29
 
@@ -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 mechanism prevents event starvation in case the run queue never
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
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'fileutils'
4
4
 
5
- require_relative './core/thread_pool'
5
+ require_relative '../core/thread_pool'
6
6
 
7
7
  ::File.singleton_class.instance_eval do
8
8
  alias_method :orig_stat, :stat
@@ -56,7 +56,7 @@ class Polyphony::RedisDriver
56
56
  reply = @reader.gets
57
57
  return reply if reply
58
58
 
59
- while (data = @connection.readpartial(8192))
59
+ @connection.read_loop do |data|
60
60
  @reader.feed(data)
61
61
  reply = @reader.gets
62
62
  return reply unless reply == false
@@ -113,10 +113,10 @@ module Polyphony
113
113
  Thread.current.backend.unref
114
114
  end
115
115
 
116
- def throttled_loop(rate, count: nil, &block)
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
@@ -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
- begin
15
- @token = @store.shift
16
- @holding_fiber = Fiber.current
17
- yield
18
- ensure
19
- @holding_fiber = nil
20
- @store << @token if @token
21
- end
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
- loop do
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 "\n"
172
+ write LINEFEED
170
173
  return
171
174
  end
172
175
 
173
- strs = args.each_with_object([]) do |a, m|
174
- a = a.to_s
175
- m << a
176
- m << "\n" unless a =~ /\n$/
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
- write(*strs)
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(remotesockaddr)
17
- Thread.current.backend.connect(self, remotesockaddr.ip_address, remotesockaddr.ip_port)
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polyphony
4
- VERSION = '0.45.0'
4
+ VERSION = '0.45.1'
5
5
  end
@@ -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', '>=2.0.8', '<2.3.0'
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'
@@ -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
@@ -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
@@ -12,6 +12,7 @@ class ThrottlerTest < MiniTest::Test
12
12
  f.stop
13
13
  elapsed = Time.now - t0
14
14
  expected = (elapsed * 10).to_i
15
+ STDOUT.orig_write "xxxxxxxx #{[elapsed, expected].inspect}\n"
15
16
  assert buffer.size >= expected - 1 && buffer.size <= expected + 1
16
17
  ensure
17
18
  t.stop
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.0
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-07-29 00:00:00.000000000 Z
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/core/01-spinning-up-fibers.rb
333
- - examples/core/02-awaiting-fibers.rb
334
- - examples/core/03-interrupting.rb
335
- - examples/core/04-handling-signals.rb
336
- - examples/core/xx-at_exit.rb
337
- - examples/core/xx-backend.rb
338
- - examples/core/xx-caller.rb
339
- - examples/core/xx-channels.rb
340
- - examples/core/xx-daemon.rb
341
- - examples/core/xx-deadlock.rb
342
- - examples/core/xx-deferring-an-operation.rb
343
- - examples/core/xx-erlang-style-genserver.rb
344
- - examples/core/xx-exception-backtrace.rb
345
- - examples/core/xx-fork-cleanup.rb
346
- - examples/core/xx-fork-spin.rb
347
- - examples/core/xx-fork-terminate.rb
348
- - examples/core/xx-forking.rb
349
- - examples/core/xx-move_on.rb
350
- - examples/core/xx-pingpong.rb
351
- - examples/core/xx-queue-async.rb
352
- - examples/core/xx-readpartial.rb
353
- - examples/core/xx-recurrent-timer.rb
354
- - examples/core/xx-resource_delegate.rb
355
- - examples/core/xx-signals.rb
356
- - examples/core/xx-sleep-forever.rb
357
- - examples/core/xx-sleeping.rb
358
- - examples/core/xx-snooze-starve.rb
359
- - examples/core/xx-spin-fork.rb
360
- - examples/core/xx-spin_error_backtrace.rb
361
- - examples/core/xx-state-machine.rb
362
- - examples/core/xx-stop.rb
363
- - examples/core/xx-supervise-process.rb
364
- - examples/core/xx-supervisors.rb
365
- - examples/core/xx-thread-selector-sleep.rb
366
- - examples/core/xx-thread-selector-snooze.rb
367
- - examples/core/xx-thread-sleep.rb
368
- - examples/core/xx-thread-snooze.rb
369
- - examples/core/xx-thread_pool.rb
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/xx-backticks.rb
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