lightio 0.4.0 → 0.4.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/Gemfile.lock +1 -1
- data/examples/http_requests.rb +2 -2
- data/lib/lightio/library/openssl.rb +10 -1
- data/lib/lightio/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 924070966457c426a62607d4273deb386f2717bd
|
4
|
+
data.tar.gz: e12903fe1825a6076d076e369a9a3e9c84d9281d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7e4b6081e60112ed2d077439b13a2a3786c6e76dd6366262597dc656192e78e6b36514035943813b684aa308cf92ade03129d68c6cdfca86b1a8b695987c716
|
7
|
+
data.tar.gz: 8bff2669c62c7b0ee425dc82ad2a32a0c64809b9caf3e4e29f2d30c46c142677102981fb73183a528f22b94259cbef2f5524128fa61f80ad6881371e4cc72c81
|
data/Gemfile.lock
CHANGED
data/examples/http_requests.rb
CHANGED
@@ -5,13 +5,13 @@ LightIO::Monkey.patch_all!
|
|
5
5
|
require 'net/http'
|
6
6
|
|
7
7
|
host = 'github.com'
|
8
|
-
port =
|
8
|
+
port = 443
|
9
9
|
|
10
10
|
start = Time.now
|
11
11
|
|
12
12
|
10.times.map do
|
13
13
|
Thread.new do
|
14
|
-
Net::HTTP.start(host, port, use_ssl:
|
14
|
+
Net::HTTP.start(host, port, use_ssl: true) do |http|
|
15
15
|
res = http.request_get('/ping')
|
16
16
|
p res.code
|
17
17
|
end
|
@@ -12,7 +12,10 @@ module LightIO::Library
|
|
12
12
|
wrap_blocking_methods :connect, :accept
|
13
13
|
|
14
14
|
def initialize(io, *args)
|
15
|
-
|
15
|
+
if io.is_a?(LightIO::Library::IO)
|
16
|
+
@_wrapped_socket = io
|
17
|
+
io = io.send(:light_io_raw_obj)
|
18
|
+
end
|
16
19
|
super(io, *args)
|
17
20
|
end
|
18
21
|
|
@@ -20,6 +23,12 @@ module LightIO::Library
|
|
20
23
|
socket = @obj.accept_nonblock(*args)
|
21
24
|
socket.is_a?(Symbol) ? socket : self.class._wrap(socket)
|
22
25
|
end
|
26
|
+
|
27
|
+
def to_io
|
28
|
+
@_wrapped_socket || @obj.io
|
29
|
+
end
|
30
|
+
|
31
|
+
alias io to_io
|
23
32
|
end
|
24
33
|
end
|
25
34
|
end
|
data/lib/lightio/version.rb
CHANGED