polyphony 0.43.11 → 0.45.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -1
  3. data/CHANGELOG.md +40 -0
  4. data/Gemfile.lock +18 -8
  5. data/Rakefile +1 -1
  6. data/TODO.md +22 -9
  7. data/docs/_posts/2020-07-26-polyphony-0.44.md +77 -0
  8. data/docs/api-reference/thread.md +1 -1
  9. data/docs/getting-started/overview.md +14 -14
  10. data/docs/getting-started/tutorial.md +1 -1
  11. data/examples/adapters/redis_client.rb +3 -1
  12. data/examples/adapters/redis_pubsub_perf.rb +11 -8
  13. data/examples/adapters/sequel_mysql.rb +23 -0
  14. data/examples/adapters/sequel_mysql_pool.rb +33 -0
  15. data/examples/adapters/sequel_pg.rb +24 -0
  16. data/examples/core/{02-awaiting-fibers.rb → await.rb} +0 -0
  17. data/examples/core/{xx-channels.rb → channels.rb} +0 -0
  18. data/examples/core/deferring-an-operation.rb +16 -0
  19. data/examples/core/{xx-erlang-style-genserver.rb → erlang-style-genserver.rb} +16 -9
  20. data/examples/core/{xx-forking.rb → forking.rb} +1 -1
  21. data/examples/core/handling-signals.rb +11 -0
  22. data/examples/core/{03-interrupting.rb → interrupt.rb} +0 -0
  23. data/examples/core/{xx-pingpong.rb → pingpong.rb} +7 -5
  24. data/examples/core/{xx-recurrent-timer.rb → recurrent-timer.rb} +1 -1
  25. data/examples/core/{xx-resource_delegate.rb → resource_delegate.rb} +3 -4
  26. data/examples/core/{01-spinning-up-fibers.rb → spin.rb} +1 -1
  27. data/examples/core/{xx-spin_error_backtrace.rb → spin_error_backtrace.rb} +1 -1
  28. data/examples/core/{xx-supervise-process.rb → supervise-process.rb} +8 -5
  29. data/examples/core/supervisor.rb +20 -0
  30. data/examples/core/{xx-thread-sleep.rb → thread-sleep.rb} +0 -0
  31. data/examples/core/{xx-thread_pool.rb → thread_pool.rb} +0 -0
  32. data/examples/core/{xx-throttling.rb → throttling.rb} +0 -0
  33. data/examples/core/{xx-timeout.rb → timeout.rb} +0 -0
  34. data/examples/core/{xx-using-a-mutex.rb → using-a-mutex.rb} +0 -0
  35. data/examples/core/{xx-worker-thread.rb → worker-thread.rb} +2 -2
  36. data/examples/io/{xx-backticks.rb → backticks.rb} +0 -0
  37. data/examples/io/{xx-echo_client.rb → echo_client.rb} +1 -1
  38. data/examples/io/{xx-echo_client_from_stdin.rb → echo_client_from_stdin.rb} +2 -2
  39. data/examples/io/{xx-echo_pipe.rb → echo_pipe.rb} +1 -1
  40. data/examples/io/{xx-echo_server.rb → echo_server.rb} +0 -0
  41. data/examples/io/{xx-echo_server_with_timeout.rb → echo_server_with_timeout.rb} +1 -1
  42. data/examples/io/{xx-echo_stdin.rb → echo_stdin.rb} +0 -0
  43. data/examples/io/{xx-happy-eyeballs.rb → happy-eyeballs.rb} +0 -0
  44. data/examples/io/{xx-httparty.rb → httparty.rb} +4 -13
  45. data/examples/io/{xx-irb.rb → irb.rb} +0 -0
  46. data/examples/io/{xx-net-http.rb → net-http.rb} +0 -0
  47. data/examples/io/{xx-open.rb → open.rb} +0 -0
  48. data/examples/io/pry.rb +18 -0
  49. data/examples/io/rack_server.rb +71 -0
  50. data/examples/io/raw.rb +14 -0
  51. data/examples/io/reline.rb +18 -0
  52. data/examples/io/{xx-system.rb → system.rb} +1 -1
  53. data/examples/io/{xx-tcpserver.rb → tcpserver.rb} +0 -0
  54. data/examples/io/{xx-tcpsocket.rb → tcpsocket.rb} +0 -0
  55. data/examples/io/tunnel.rb +6 -1
  56. data/examples/io/{xx-zip.rb → zip.rb} +0 -0
  57. data/examples/performance/fiber_transfer.rb +2 -1
  58. data/examples/performance/fs_read.rb +5 -6
  59. data/examples/{io/xx-switch.rb → performance/switch.rb} +2 -1
  60. data/examples/performance/thread-vs-fiber/{xx-httparty_multi.rb → httparty_multi.rb} +3 -4
  61. data/examples/performance/thread-vs-fiber/{xx-httparty_threaded.rb → httparty_threaded.rb} +0 -0
  62. data/examples/performance/thread-vs-fiber/polyphony_mt_server.rb +1 -1
  63. data/examples/performance/thread-vs-fiber/polyphony_server.rb +1 -1
  64. data/examples/performance/thread-vs-fiber/polyphony_server_read_loop.rb +1 -1
  65. data/examples/performance/thread-vs-fiber/threaded_server.rb +1 -5
  66. data/examples/performance/thread_pool_perf.rb +6 -7
  67. data/ext/polyphony/backend.h +40 -0
  68. data/ext/polyphony/event.c +3 -3
  69. data/ext/polyphony/extconf.rb +1 -1
  70. data/ext/polyphony/fiber.c +66 -6
  71. data/ext/polyphony/{libev_agent.c → libev_backend.c} +237 -238
  72. data/ext/polyphony/polyphony.c +3 -3
  73. data/ext/polyphony/polyphony.h +15 -20
  74. data/ext/polyphony/polyphony_ext.c +3 -4
  75. data/ext/polyphony/queue.c +5 -6
  76. data/ext/polyphony/ring_buffer.c +0 -1
  77. data/ext/polyphony/thread.c +36 -33
  78. data/lib/polyphony.rb +26 -39
  79. data/lib/polyphony/adapters/fs.rb +1 -1
  80. data/lib/polyphony/adapters/irb.rb +2 -17
  81. data/lib/polyphony/adapters/mysql2.rb +19 -0
  82. data/lib/polyphony/adapters/postgres.rb +5 -5
  83. data/lib/polyphony/adapters/process.rb +2 -5
  84. data/lib/polyphony/adapters/readline.rb +17 -0
  85. data/lib/polyphony/adapters/redis.rb +1 -1
  86. data/lib/polyphony/adapters/sequel.rb +45 -0
  87. data/lib/polyphony/core/exceptions.rb +11 -0
  88. data/lib/polyphony/core/global_api.rb +17 -12
  89. data/lib/polyphony/core/resource_pool.rb +20 -7
  90. data/lib/polyphony/core/sync.rb +46 -8
  91. data/lib/polyphony/core/throttler.rb +1 -1
  92. data/lib/polyphony/extensions/core.rb +30 -30
  93. data/lib/polyphony/extensions/fiber.rb +30 -49
  94. data/lib/polyphony/extensions/io.rb +60 -16
  95. data/lib/polyphony/extensions/openssl.rb +6 -6
  96. data/lib/polyphony/extensions/socket.rb +14 -15
  97. data/lib/polyphony/extensions/thread.rb +6 -5
  98. data/lib/polyphony/version.rb +1 -1
  99. data/polyphony.gemspec +7 -3
  100. data/test/helper.rb +1 -1
  101. data/test/{test_agent.rb → test_backend.rb} +22 -22
  102. data/test/test_fiber.rb +29 -12
  103. data/test/test_io.rb +59 -1
  104. data/test/test_kernel.rb +5 -0
  105. data/test/test_resource_pool.rb +29 -4
  106. data/test/test_signal.rb +16 -37
  107. data/test/test_socket.rb +17 -0
  108. data/test/test_sync.rb +52 -0
  109. metadata +127 -97
  110. data/.gitbook.yaml +0 -4
  111. data/examples/adapters/concurrent-ruby.rb +0 -9
  112. data/examples/core/04-handling-signals.rb +0 -19
  113. data/examples/core/xx-agent.rb +0 -102
  114. data/examples/core/xx-at_exit.rb +0 -29
  115. data/examples/core/xx-caller.rb +0 -12
  116. data/examples/core/xx-daemon.rb +0 -14
  117. data/examples/core/xx-deadlock.rb +0 -8
  118. data/examples/core/xx-deferring-an-operation.rb +0 -14
  119. data/examples/core/xx-exception-backtrace.rb +0 -40
  120. data/examples/core/xx-fork-cleanup.rb +0 -22
  121. data/examples/core/xx-fork-spin.rb +0 -42
  122. data/examples/core/xx-fork-terminate.rb +0 -27
  123. data/examples/core/xx-move_on.rb +0 -23
  124. data/examples/core/xx-queue-async.rb +0 -120
  125. data/examples/core/xx-readpartial.rb +0 -18
  126. data/examples/core/xx-signals.rb +0 -16
  127. data/examples/core/xx-sleep-forever.rb +0 -9
  128. data/examples/core/xx-sleeping.rb +0 -25
  129. data/examples/core/xx-snooze-starve.rb +0 -16
  130. data/examples/core/xx-spin-fork.rb +0 -49
  131. data/examples/core/xx-state-machine.rb +0 -51
  132. data/examples/core/xx-stop.rb +0 -20
  133. data/examples/core/xx-supervisors.rb +0 -21
  134. data/examples/core/xx-thread-selector-sleep.rb +0 -51
  135. data/examples/core/xx-thread-selector-snooze.rb +0 -46
  136. data/examples/core/xx-thread-snooze.rb +0 -34
  137. data/examples/core/xx-timer-gc.rb +0 -17
  138. data/examples/core/xx-trace.rb +0 -79
  139. data/examples/performance/xx-array.rb +0 -11
  140. data/examples/performance/xx-fiber-switch.rb +0 -9
  141. data/examples/performance/xx-snooze.rb +0 -15
  142. data/examples/xx-spin.rb +0 -32
  143. data/ext/polyphony/agent.h +0 -41
@@ -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
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ class MutexTest < MiniTest::Test
6
+ def test_mutex
7
+ buf = []
8
+ lock = Polyphony::Mutex.new
9
+ (1..3).each do |i|
10
+ spin do
11
+ lock.synchronize do
12
+ buf << ">> #{i}"
13
+ sleep(rand * 0.05)
14
+ buf << "<< #{i}"
15
+ end
16
+ end
17
+ end
18
+
19
+ Fiber.current.await_all_children
20
+ assert_equal ['>> 1', '<< 1', '>> 2', '<< 2', '>> 3', '<< 3'], buf
21
+ end
22
+
23
+ def test_condition_variable
24
+ buf = []
25
+ lock1 = Polyphony::Mutex.new
26
+ lock2 = Polyphony::Mutex.new
27
+ cond = Polyphony::ConditionVariable.new
28
+
29
+ spin do
30
+ lock1.synchronize do
31
+ sleep 0.01
32
+ cond.wait(lock1)
33
+ lock2.synchronize do
34
+ buf << :foo
35
+ end
36
+ end
37
+ end
38
+
39
+ spin do
40
+ lock2.synchronize do
41
+ sleep 0.01
42
+ lock1.synchronize do
43
+ buf << :bar
44
+ end
45
+ cond.signal
46
+ end
47
+ end
48
+
49
+ Fiber.current.await_all_children
50
+ assert_equal [:bar, :foo], buf
51
+ end
52
+ end
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyphony
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.11
4
+ version: 0.45.4
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-24 00:00:00.000000000 Z
11
+ date: 2020-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: httparty
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '='
18
- - !ruby/object:Gem::Version
19
- version: 0.17.0
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '='
25
- - !ruby/object:Gem::Version
26
- version: 0.17.0
27
- - !ruby/object:Gem::Dependency
28
- name: localhost
14
+ name: rake-compiler
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - '='
32
18
  - !ruby/object:Gem::Version
33
- version: 1.1.4
19
+ version: 1.1.1
34
20
  type: :development
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - '='
39
25
  - !ruby/object:Gem::Version
40
- version: 1.1.4
26
+ version: 1.1.1
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: minitest
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -95,33 +81,33 @@ dependencies:
95
81
  - !ruby/object:Gem::Version
96
82
  version: 0.85.1
97
83
  - !ruby/object:Gem::Dependency
98
- name: pg
84
+ name: pry
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - '='
102
88
  - !ruby/object:Gem::Version
103
- version: 1.1.4
89
+ version: 0.13.1
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
94
  - - '='
109
95
  - !ruby/object:Gem::Version
110
- version: 1.1.4
96
+ version: 0.13.1
111
97
  - !ruby/object:Gem::Dependency
112
- name: rake-compiler
98
+ name: pg
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - '='
116
102
  - !ruby/object:Gem::Version
117
- version: 1.0.5
103
+ version: 1.1.4
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
108
  - - '='
123
109
  - !ruby/object:Gem::Version
124
- version: 1.0.5
110
+ version: 1.1.4
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: redis
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +150,68 @@ dependencies:
164
150
  - - "~>"
165
151
  - !ruby/object:Gem::Version
166
152
  version: 0.6.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: rack
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: 2.0.8
160
+ - - "<"
161
+ - !ruby/object:Gem::Version
162
+ version: 2.3.0
163
+ type: :development
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: 2.0.8
170
+ - - "<"
171
+ - !ruby/object:Gem::Version
172
+ version: 2.3.0
173
+ - !ruby/object:Gem::Dependency
174
+ name: mysql2
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - '='
178
+ - !ruby/object:Gem::Version
179
+ version: 0.5.3
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - '='
185
+ - !ruby/object:Gem::Version
186
+ version: 0.5.3
187
+ - !ruby/object:Gem::Dependency
188
+ name: sequel
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - '='
192
+ - !ruby/object:Gem::Version
193
+ version: 5.34.0
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - '='
199
+ - !ruby/object:Gem::Version
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
167
215
  - !ruby/object:Gem::Dependency
168
216
  name: jekyll
169
217
  requirement: !ruby/object:Gem::Requirement
@@ -228,7 +276,6 @@ extensions:
228
276
  extra_rdoc_files:
229
277
  - README.md
230
278
  files:
231
- - ".gitbook.yaml"
232
279
  - ".github/workflows/test.yml"
233
280
  - ".gitignore"
234
281
  - ".rubocop.yml"
@@ -245,6 +292,7 @@ files:
245
292
  - docs/_config.yml
246
293
  - docs/_includes/head.html
247
294
  - docs/_includes/title.html
295
+ - docs/_posts/2020-07-26-polyphony-0.44.md
248
296
  - docs/_sass/custom/custom.scss
249
297
  - docs/_sass/overrides.scss
250
298
  - docs/_user-guide/all-about-timers.md
@@ -283,7 +331,6 @@ files:
283
331
  - docs/main-concepts/fiber-scheduling.md
284
332
  - docs/main-concepts/index.md
285
333
  - docs/polyphony-logo.png
286
- - examples/adapters/concurrent-ruby.rb
287
334
  - examples/adapters/pg_client.rb
288
335
  - examples/adapters/pg_notify.rb
289
336
  - examples/adapters/pg_pool.rb
@@ -293,68 +340,50 @@ files:
293
340
  - examples/adapters/redis_client.rb
294
341
  - examples/adapters/redis_pubsub.rb
295
342
  - examples/adapters/redis_pubsub_perf.rb
296
- - examples/core/01-spinning-up-fibers.rb
297
- - examples/core/02-awaiting-fibers.rb
298
- - examples/core/03-interrupting.rb
299
- - examples/core/04-handling-signals.rb
300
- - examples/core/xx-agent.rb
301
- - examples/core/xx-at_exit.rb
302
- - examples/core/xx-caller.rb
303
- - examples/core/xx-channels.rb
304
- - examples/core/xx-daemon.rb
305
- - examples/core/xx-deadlock.rb
306
- - examples/core/xx-deferring-an-operation.rb
307
- - examples/core/xx-erlang-style-genserver.rb
308
- - examples/core/xx-exception-backtrace.rb
309
- - examples/core/xx-fork-cleanup.rb
310
- - examples/core/xx-fork-spin.rb
311
- - examples/core/xx-fork-terminate.rb
312
- - examples/core/xx-forking.rb
313
- - examples/core/xx-move_on.rb
314
- - examples/core/xx-pingpong.rb
315
- - examples/core/xx-queue-async.rb
316
- - examples/core/xx-readpartial.rb
317
- - examples/core/xx-recurrent-timer.rb
318
- - examples/core/xx-resource_delegate.rb
319
- - examples/core/xx-signals.rb
320
- - examples/core/xx-sleep-forever.rb
321
- - examples/core/xx-sleeping.rb
322
- - examples/core/xx-snooze-starve.rb
323
- - examples/core/xx-spin-fork.rb
324
- - examples/core/xx-spin_error_backtrace.rb
325
- - examples/core/xx-state-machine.rb
326
- - examples/core/xx-stop.rb
327
- - examples/core/xx-supervise-process.rb
328
- - examples/core/xx-supervisors.rb
329
- - examples/core/xx-thread-selector-sleep.rb
330
- - examples/core/xx-thread-selector-snooze.rb
331
- - examples/core/xx-thread-sleep.rb
332
- - examples/core/xx-thread-snooze.rb
333
- - examples/core/xx-thread_pool.rb
334
- - examples/core/xx-throttling.rb
335
- - examples/core/xx-timeout.rb
336
- - examples/core/xx-timer-gc.rb
337
- - examples/core/xx-trace.rb
338
- - examples/core/xx-using-a-mutex.rb
339
- - examples/core/xx-worker-thread.rb
343
+ - examples/adapters/sequel_mysql.rb
344
+ - examples/adapters/sequel_mysql_pool.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/raw.rb
381
+ - examples/io/reline.rb
382
+ - examples/io/system.rb
383
+ - examples/io/tcpserver.rb
384
+ - examples/io/tcpsocket.rb
340
385
  - examples/io/tunnel.rb
341
- - examples/io/xx-backticks.rb
342
- - examples/io/xx-echo_client.rb
343
- - examples/io/xx-echo_client_from_stdin.rb
344
- - examples/io/xx-echo_pipe.rb
345
- - examples/io/xx-echo_server.rb
346
- - examples/io/xx-echo_server_with_timeout.rb
347
- - examples/io/xx-echo_stdin.rb
348
- - examples/io/xx-happy-eyeballs.rb
349
- - examples/io/xx-httparty.rb
350
- - examples/io/xx-irb.rb
351
- - examples/io/xx-net-http.rb
352
- - examples/io/xx-open.rb
353
- - examples/io/xx-switch.rb
354
- - examples/io/xx-system.rb
355
- - examples/io/xx-tcpserver.rb
356
- - examples/io/xx-tcpsocket.rb
357
- - examples/io/xx-zip.rb
386
+ - examples/io/zip.rb
358
387
  - examples/performance/fiber_transfer.rb
359
388
  - examples/performance/fs_read.rb
360
389
  - examples/performance/mem-usage.rb
@@ -362,17 +391,14 @@ files:
362
391
  - examples/performance/multi_snooze.rb
363
392
  - examples/performance/snooze.rb
364
393
  - examples/performance/snooze_raw.rb
394
+ - examples/performance/switch.rb
395
+ - examples/performance/thread-vs-fiber/httparty_multi.rb
396
+ - examples/performance/thread-vs-fiber/httparty_threaded.rb
365
397
  - examples/performance/thread-vs-fiber/polyphony_mt_server.rb
366
398
  - examples/performance/thread-vs-fiber/polyphony_server.rb
367
399
  - examples/performance/thread-vs-fiber/polyphony_server_read_loop.rb
368
400
  - examples/performance/thread-vs-fiber/threaded_server.rb
369
- - examples/performance/thread-vs-fiber/xx-httparty_multi.rb
370
- - examples/performance/thread-vs-fiber/xx-httparty_threaded.rb
371
401
  - examples/performance/thread_pool_perf.rb
372
- - examples/performance/xx-array.rb
373
- - examples/performance/xx-fiber-switch.rb
374
- - examples/performance/xx-snooze.rb
375
- - examples/xx-spin.rb
376
402
  - ext/libev/Changes
377
403
  - ext/libev/LICENSE
378
404
  - ext/libev/README
@@ -389,13 +415,13 @@ files:
389
415
  - ext/libev/ev_win32.c
390
416
  - ext/libev/ev_wrap.h
391
417
  - ext/libev/test_libev_win32.c
392
- - ext/polyphony/agent.h
418
+ - ext/polyphony/backend.h
393
419
  - ext/polyphony/event.c
394
420
  - ext/polyphony/extconf.rb
395
421
  - ext/polyphony/fiber.c
396
422
  - ext/polyphony/libev.c
397
423
  - ext/polyphony/libev.h
398
- - ext/polyphony/libev_agent.c
424
+ - ext/polyphony/libev_backend.c
399
425
  - ext/polyphony/polyphony.c
400
426
  - ext/polyphony/polyphony.h
401
427
  - ext/polyphony/polyphony_ext.c
@@ -407,9 +433,12 @@ files:
407
433
  - lib/polyphony.rb
408
434
  - lib/polyphony/adapters/fs.rb
409
435
  - lib/polyphony/adapters/irb.rb
436
+ - lib/polyphony/adapters/mysql2.rb
410
437
  - lib/polyphony/adapters/postgres.rb
411
438
  - lib/polyphony/adapters/process.rb
439
+ - lib/polyphony/adapters/readline.rb
412
440
  - lib/polyphony/adapters/redis.rb
441
+ - lib/polyphony/adapters/sequel.rb
413
442
  - lib/polyphony/adapters/trace.rb
414
443
  - lib/polyphony/core/channel.rb
415
444
  - lib/polyphony/core/exceptions.rb
@@ -433,7 +462,7 @@ files:
433
462
  - test/q.rb
434
463
  - test/run.rb
435
464
  - test/stress.rb
436
- - test/test_agent.rb
465
+ - test/test_backend.rb
437
466
  - test/test_event.rb
438
467
  - test/test_ext.rb
439
468
  - test/test_fiber.rb
@@ -446,6 +475,7 @@ files:
446
475
  - test/test_signal.rb
447
476
  - test/test_socket.rb
448
477
  - test/test_supervise.rb
478
+ - test/test_sync.rb
449
479
  - test/test_thread.rb
450
480
  - test/test_thread_pool.rb
451
481
  - test/test_throttler.rb
@@ -1,4 +0,0 @@
1
- root: ./docs/
2
- structure:
3
- readme: ./README.md
4
- summary: ./summary.md
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/setup'
4
- require 'polyphony'
5
- require 'concurrent'
6
-
7
- puts "Hello, concurrent-ruby"
8
-
9
- # this program should not hang with concurrent-ruby 1.1.6 (see issue #22)
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/setup'
4
- require 'polyphony'
5
-
6
- # trap('TERM') do
7
- # Polyphony.emit_signal_exception(::SystemExit)
8
- # end
9
-
10
- # trap('INT') do
11
- # Polyphony.emit_signal_exception(::Interrupt)
12
- # end
13
-
14
- puts "go to sleep"
15
- begin
16
- sleep
17
- ensure
18
- puts "done sleeping"
19
- end