async-io 1.29.0 → 1.32.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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/async/io/host_endpoint.rb +1 -1
  3. data/lib/async/io/peer.rb +2 -2
  4. data/lib/async/io/shared_endpoint.rb +4 -4
  5. data/lib/async/io/socket.rb +2 -2
  6. data/lib/async/io/ssl_socket.rb +2 -4
  7. data/lib/async/io/stream.rb +2 -2
  8. data/lib/async/io/tcp_socket.rb +1 -1
  9. data/lib/async/io/threads.rb +42 -20
  10. data/lib/async/io/trap.rb +8 -3
  11. data/lib/async/io/version.rb +1 -1
  12. metadata +43 -95
  13. data/.editorconfig +0 -6
  14. data/.github/workflows/development.yml +0 -55
  15. data/.gitignore +0 -13
  16. data/.rspec +0 -3
  17. data/.yardopts +0 -2
  18. data/Gemfile +0 -13
  19. data/README.md +0 -171
  20. data/async-io.gemspec +0 -30
  21. data/examples/allocations/byteslice.rb +0 -29
  22. data/examples/allocations/memory.rb +0 -16
  23. data/examples/allocations/read_chunks.rb +0 -18
  24. data/examples/chat/client.rb +0 -58
  25. data/examples/chat/server.rb +0 -83
  26. data/examples/defer/worker.rb +0 -29
  27. data/examples/echo/client.rb +0 -23
  28. data/examples/echo/server.rb +0 -58
  29. data/examples/issues/broken_ssl.rb +0 -15
  30. data/examples/issues/pipes.rb +0 -34
  31. data/examples/millions/client.rb +0 -44
  32. data/examples/millions/server.rb +0 -41
  33. data/examples/udp/client.rb +0 -14
  34. data/examples/udp/server.rb +0 -16
  35. data/gems/nio4r-2.3.gemfile +0 -3
  36. data/spec/addrinfo.rb +0 -16
  37. data/spec/async/io/buffer_spec.rb +0 -48
  38. data/spec/async/io/c10k_spec.rb +0 -138
  39. data/spec/async/io/echo_spec.rb +0 -75
  40. data/spec/async/io/endpoint_spec.rb +0 -105
  41. data/spec/async/io/generic_examples.rb +0 -73
  42. data/spec/async/io/generic_spec.rb +0 -107
  43. data/spec/async/io/notification_spec.rb +0 -46
  44. data/spec/async/io/protocol/line_spec.rb +0 -81
  45. data/spec/async/io/shared_endpoint/server_spec.rb +0 -72
  46. data/spec/async/io/shared_endpoint_spec.rb +0 -65
  47. data/spec/async/io/socket/tcp_spec.rb +0 -101
  48. data/spec/async/io/socket/udp_spec.rb +0 -65
  49. data/spec/async/io/socket_spec.rb +0 -149
  50. data/spec/async/io/ssl_server_spec.rb +0 -133
  51. data/spec/async/io/ssl_socket_spec.rb +0 -96
  52. data/spec/async/io/standard_spec.rb +0 -47
  53. data/spec/async/io/stream_context.rb +0 -30
  54. data/spec/async/io/stream_spec.rb +0 -337
  55. data/spec/async/io/tcp_socket_spec.rb +0 -84
  56. data/spec/async/io/threads_spec.rb +0 -59
  57. data/spec/async/io/trap_spec.rb +0 -52
  58. data/spec/async/io/udp_socket_spec.rb +0 -56
  59. data/spec/async/io/unix_endpoint_spec.rb +0 -106
  60. data/spec/async/io/unix_socket_spec.rb +0 -66
  61. data/spec/async/io/wrap/http_rb_spec.rb +0 -47
  62. data/spec/async/io/wrap/tcp_spec.rb +0 -79
  63. data/spec/spec_helper.rb +0 -15
@@ -1,79 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
22
-
23
- require 'net/http'
24
-
25
- require 'async/io/tcp_socket'
26
-
27
- # There are different ways to achieve this. This is really just a proof of concept.
28
- module Wrap
29
- module TCPServer
30
- def self.new(*args)
31
- if Async::Task.current?
32
- Async::IO::TCPServer.new(*args)
33
- else
34
- ::TCPServer.new(*args)
35
- end
36
- end
37
- end
38
-
39
- module TCPSocket
40
- def self.new(*args)
41
- if Async::Task.current?
42
- Async::IO::TCPSocket.new(*args)
43
- else
44
- ::TCPSocket.new(*args)
45
- end
46
- end
47
-
48
- def self.open(*args)
49
- self.new(*args)
50
- end
51
- end
52
- end
53
-
54
- # TruffleRuby uses Socket.tcp in Net::HTTP.get_response, not TCPSocket.open
55
- RSpec.describe Async::IO::TCPSocket, if: RUBY_ENGINE != "truffleruby" do
56
- describe "inside reactor" do
57
- include_context Async::RSpec::Reactor
58
-
59
- before(:all) do
60
- Net::HTTP.include(Wrap)
61
- end
62
-
63
- it "should fetch page" do
64
- expect(Async::IO::TCPSocket).to receive(:new).and_call_original
65
-
66
- expect do
67
- Net::HTTP.get_response('www.google.com', '/')
68
- end.to_not raise_exception
69
- end
70
- end
71
-
72
- describe "outside reactor" do
73
- it "should fetch page" do
74
- expect do
75
- Net::HTTP.get_response('www.google.com', '/')
76
- end.to_not raise_exception
77
- end
78
- end
79
- end
data/spec/spec_helper.rb DELETED
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'covered/rspec'
4
- require "async/rspec"
5
-
6
- require_relative 'addrinfo'
7
-
8
- RSpec.configure do |config|
9
- # Enable flags like --only-failures and --next-failure
10
- config.example_status_persistence_file_path = ".rspec_status"
11
-
12
- config.expect_with :rspec do |c|
13
- c.syntax = :expect
14
- end
15
- end