cool.io 1.2.3-x86-mingw32 → 1.4.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.travis.yml +3 -3
- data/CHANGES.md +35 -0
- data/README.md +1 -3
- data/Rakefile +11 -13
- data/cool.io.gemspec +3 -2
- data/examples/callbacked_echo_server.rb +24 -0
- data/ext/cool.io/extconf.rb +8 -24
- data/ext/cool.io/loop.c +1 -1
- data/ext/iobuffer/iobuffer.c +2 -0
- data/ext/libev/Changes +123 -4
- data/ext/libev/LICENSE +2 -1
- data/ext/libev/README +8 -8
- data/ext/libev/ev.c +313 -144
- data/ext/libev/ev.h +18 -10
- data/ext/libev/ev_epoll.c +4 -1
- data/ext/libev/ev_kqueue.c +1 -1
- data/ext/libev/ev_select.c +3 -4
- data/ext/libev/ev_vars.h +3 -2
- data/ext/libev/ev_win32.c +1 -1
- data/ext/libev/win_select.patch +115 -0
- data/lib/cool.io.rb +6 -4
- data/lib/cool.io/dns_resolver.rb +4 -10
- data/lib/cool.io/dsl.rb +6 -2
- data/lib/cool.io/io.rb +36 -16
- data/lib/cool.io/loop.rb +3 -11
- data/lib/cool.io/meta.rb +2 -2
- data/lib/cool.io/version.rb +4 -2
- data/spec/async_watcher_spec.rb +5 -5
- data/spec/dns_spec.rb +11 -7
- data/spec/iobuffer_spec.rb +147 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/stat_watcher_spec.rb +3 -3
- data/spec/tcp_server_spec.rb +98 -5
- data/spec/tcp_socket_spec.rb +185 -0
- data/spec/timer_watcher_spec.rb +23 -19
- data/spec/udp_socket_spec.rb +58 -0
- data/spec/unix_listener_spec.rb +7 -7
- data/spec/unix_server_spec.rb +7 -7
- metadata +83 -103
- data/examples/httpclient.rb +0 -38
- data/ext/http11_client/.gitignore +0 -5
- data/ext/http11_client/LICENSE +0 -31
- data/ext/http11_client/ext_help.h +0 -14
- data/ext/http11_client/extconf.rb +0 -6
- data/ext/http11_client/http11_client.c +0 -300
- data/ext/http11_client/http11_parser.c +0 -403
- data/ext/http11_client/http11_parser.h +0 -48
- data/ext/http11_client/http11_parser.rl +0 -173
- data/lib/cool.io/eventmachine.rb +0 -234
- data/lib/cool.io/http_client.rb +0 -427
data/spec/timer_watcher_spec.rb
CHANGED
@@ -4,15 +4,19 @@ describe Cool.io::TimerWatcher do
|
|
4
4
|
|
5
5
|
interval = 0.010
|
6
6
|
|
7
|
+
let :loop do
|
8
|
+
Cool.io::Loop.new
|
9
|
+
end
|
10
|
+
|
7
11
|
it "can have the on_timer callback defined after creation" do
|
8
12
|
@watcher = Cool.io::TimerWatcher.new(interval, true)
|
9
13
|
nr = '0'
|
10
|
-
@watcher.on_timer { nr.succ! }.
|
11
|
-
@watcher.attach(
|
12
|
-
nr.
|
14
|
+
expect(@watcher.on_timer { nr.succ! }).to be_nil
|
15
|
+
expect(@watcher.attach(loop)).to eq(@watcher)
|
16
|
+
expect(nr).to eq('0')
|
13
17
|
sleep interval
|
14
|
-
|
15
|
-
nr.
|
18
|
+
loop.run_once
|
19
|
+
expect(nr).to eq('1')
|
16
20
|
end
|
17
21
|
|
18
22
|
it "can be subclassed" do
|
@@ -24,29 +28,29 @@ describe Cool.io::TimerWatcher do
|
|
24
28
|
end
|
25
29
|
end
|
26
30
|
@watcher = MyTimerWatcher.new(interval, true)
|
27
|
-
@watcher.attach(
|
28
|
-
MyTimerWatcher::TMP.
|
31
|
+
expect(@watcher.attach(loop)).to eq(@watcher)
|
32
|
+
expect(MyTimerWatcher::TMP).to eq('0')
|
29
33
|
sleep interval
|
30
|
-
|
31
|
-
MyTimerWatcher::TMP.
|
34
|
+
loop.run_once
|
35
|
+
expect(MyTimerWatcher::TMP).to eq('1')
|
32
36
|
end
|
33
37
|
|
34
38
|
it "can have the on_timer callback redefined between runs" do
|
35
39
|
@watcher = Cool.io::TimerWatcher.new(interval, true)
|
36
40
|
nr = '0'
|
37
|
-
@watcher.on_timer { nr.succ! }.
|
38
|
-
@watcher.attach(
|
39
|
-
nr.
|
41
|
+
expect(@watcher.on_timer { nr.succ! }).to be_nil
|
42
|
+
expect(@watcher.attach(loop)).to eq(@watcher)
|
43
|
+
expect(nr).to eq('0')
|
40
44
|
sleep interval
|
41
|
-
|
42
|
-
nr.
|
45
|
+
loop.run_once
|
46
|
+
expect(nr).to eq('1')
|
43
47
|
@watcher.detach
|
44
|
-
@watcher.on_timer { nr = :foo }.
|
45
|
-
@watcher.attach(
|
46
|
-
nr.
|
48
|
+
expect(@watcher.on_timer { nr = :foo }).to be_nil
|
49
|
+
expect(@watcher.attach(loop)).to eq(@watcher)
|
50
|
+
expect(nr).to eq('1')
|
47
51
|
sleep interval
|
48
|
-
|
49
|
-
nr.
|
52
|
+
loop.run_once
|
53
|
+
expect(nr).to eq(:foo)
|
50
54
|
end
|
51
55
|
|
52
56
|
after :each do
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe "Coolio::UDPSocket" do
|
4
|
+
let :loop do
|
5
|
+
Coolio::Loop.new
|
6
|
+
end
|
7
|
+
|
8
|
+
before :each do
|
9
|
+
@echo = UDPSocket.open
|
10
|
+
@echo.bind nil, 0
|
11
|
+
@port = @echo.addr[1]
|
12
|
+
|
13
|
+
@running = true
|
14
|
+
@echo_thread = Thread.new do
|
15
|
+
while @running
|
16
|
+
begin
|
17
|
+
msg, sender = @echo.recvfrom_nonblock(3)
|
18
|
+
@echo.send(msg + "bbb", 0, sender[3], sender[1])
|
19
|
+
rescue IO::WaitReadable
|
20
|
+
end
|
21
|
+
Thread.pass
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
after :each do
|
27
|
+
@running = false
|
28
|
+
@echo_thread.join
|
29
|
+
@echo.close
|
30
|
+
end
|
31
|
+
|
32
|
+
class Readable < Cool.io::IOWatcher
|
33
|
+
attr :socket, :received
|
34
|
+
def initialize
|
35
|
+
@socket = UDPSocket.new
|
36
|
+
super(@socket)
|
37
|
+
end
|
38
|
+
|
39
|
+
def on_readable
|
40
|
+
@received = @socket.recvfrom_nonblock(6).first
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
it "receive message #on_readable 5 times" do
|
45
|
+
5.times do
|
46
|
+
begin
|
47
|
+
r = Readable.new
|
48
|
+
r.socket.send "aaa", 0, "localhost", @port
|
49
|
+
|
50
|
+
loop.attach r
|
51
|
+
loop.run_once
|
52
|
+
expect(r.received).to eq "aaabbb"
|
53
|
+
ensure
|
54
|
+
r.detach
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/spec/unix_listener_spec.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
require File.expand_path('../spec_helper', __FILE__)
|
2
2
|
require 'tempfile'
|
3
3
|
|
4
|
-
describe Cool.io::UNIXListener, :env => :
|
4
|
+
describe Cool.io::UNIXListener, :env => :exclude_win do
|
5
5
|
|
6
6
|
before :each do
|
7
7
|
@tmp = Tempfile.new('coolio_unix_listener_spec')
|
8
|
-
File.unlink(@tmp.path).
|
9
|
-
File.exist?(@tmp.path).
|
8
|
+
expect(File.unlink(@tmp.path)).to eq(1)
|
9
|
+
expect(File.exist?(@tmp.path)).to eq(false)
|
10
10
|
end
|
11
11
|
|
12
12
|
it "creates a new UNIXListener" do
|
13
13
|
listener = Cool.io::UNIXListener.new(@tmp.path)
|
14
|
-
File.socket?(@tmp.path).
|
14
|
+
expect(File.socket?(@tmp.path)).to eq(true)
|
15
15
|
end
|
16
16
|
|
17
17
|
it "builds off an existing UNIXServer" do
|
18
18
|
unix_server = UNIXServer.new(@tmp.path)
|
19
|
-
File.socket?(@tmp.path).
|
19
|
+
expect(File.socket?(@tmp.path)).to eq(true)
|
20
20
|
listener = Cool.io::UNIXListener.new(unix_server)
|
21
|
-
File.socket?(@tmp.path).
|
22
|
-
listener.fileno.
|
21
|
+
expect(File.socket?(@tmp.path)).to eq(true)
|
22
|
+
expect(listener.fileno).to eq(unix_server.fileno)
|
23
23
|
end
|
24
24
|
|
25
25
|
end
|
data/spec/unix_server_spec.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
require File.expand_path('../spec_helper', __FILE__)
|
2
2
|
require 'tempfile'
|
3
3
|
|
4
|
-
describe Cool.io::UNIXServer, :env => :
|
4
|
+
describe Cool.io::UNIXServer, :env => :exclude_win do
|
5
5
|
|
6
6
|
before :each do
|
7
7
|
@tmp = Tempfile.new('coolio_unix_server_spec')
|
8
|
-
File.unlink(@tmp.path).
|
9
|
-
File.exist?(@tmp.path).
|
8
|
+
expect(File.unlink(@tmp.path)).to eq(1)
|
9
|
+
expect(File.exist?(@tmp.path)).to eq(false)
|
10
10
|
end
|
11
11
|
|
12
12
|
it "creates a new Cool.io::UNIXServer" do
|
13
13
|
listener = Cool.io::UNIXListener.new(@tmp.path)
|
14
14
|
listener.listen(24)
|
15
|
-
File.socket?(@tmp.path).
|
15
|
+
expect(File.socket?(@tmp.path)).to eq(true)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "builds off an existing ::UNIXServer" do
|
19
19
|
unix_server = ::UNIXServer.new(@tmp.path)
|
20
|
-
File.socket?(@tmp.path).
|
20
|
+
expect(File.socket?(@tmp.path)).to eq(true)
|
21
21
|
listener = Cool.io::UNIXServer.new(unix_server, Coolio::UNIXSocket)
|
22
22
|
listener.listen(24)
|
23
|
-
File.socket?(@tmp.path).
|
24
|
-
listener.fileno.
|
23
|
+
expect(File.socket?(@tmp.path)).to eq(true)
|
24
|
+
expect(listener.fileno).to eq(unix_server.fileno)
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
metadata
CHANGED
@@ -1,98 +1,96 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cool.io
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
- 3
|
10
|
-
version: 1.2.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.4.1
|
11
5
|
platform: x86-mingw32
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Tony Arcieri
|
14
8
|
- Masahiro Nakagawa
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
23
|
-
type: :development
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 57
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 8
|
33
|
-
- 3
|
34
|
-
version: 0.8.3
|
12
|
+
date: 2015-10-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
35
15
|
name: rake-compiler
|
36
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.9.5
|
21
|
+
type: :development
|
37
22
|
prerelease: false
|
38
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.9.5
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake-compiler-dock
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.4.3
|
39
35
|
type: :development
|
40
|
-
|
41
|
-
|
42
|
-
requirements:
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.4.3
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rspec
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
43
46
|
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 59
|
46
|
-
segments:
|
47
|
-
- 2
|
48
|
-
- 13
|
49
|
-
- 0
|
47
|
+
- !ruby/object:Gem::Version
|
50
48
|
version: 2.13.0
|
51
|
-
name: rspec
|
52
|
-
version_requirements: *id002
|
53
|
-
prerelease: false
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
49
|
type: :development
|
56
|
-
|
57
|
-
|
58
|
-
requirements:
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
59
53
|
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
63
|
-
- 3
|
64
|
-
- 6
|
65
|
-
- 0
|
66
|
-
version: 3.6.0
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 2.13.0
|
56
|
+
- !ruby/object:Gem::Dependency
|
67
57
|
name: rdoc
|
68
|
-
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 3.6.0
|
63
|
+
type: :development
|
69
64
|
prerelease: false
|
70
|
-
|
71
|
-
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 3.6.0
|
70
|
+
description: Cool.io provides a high performance event framework for Ruby which uses
|
71
|
+
the libev C library
|
72
|
+
email:
|
72
73
|
- tony.arcieri@gmail.com
|
73
74
|
- repeatedly@gmail.com
|
74
75
|
executables: []
|
75
|
-
|
76
76
|
extensions: []
|
77
|
-
|
78
77
|
extra_rdoc_files: []
|
79
|
-
|
80
|
-
|
81
|
-
- .
|
82
|
-
- .
|
83
|
-
- .travis.yml
|
78
|
+
files:
|
79
|
+
- ".gitignore"
|
80
|
+
- ".rspec"
|
81
|
+
- ".travis.yml"
|
84
82
|
- CHANGES.md
|
85
83
|
- Gemfile
|
86
84
|
- LICENSE
|
87
85
|
- README.md
|
88
86
|
- Rakefile
|
89
87
|
- cool.io.gemspec
|
88
|
+
- examples/callbacked_echo_server.rb
|
90
89
|
- examples/dslified_echo_client.rb
|
91
90
|
- examples/dslified_echo_server.rb
|
92
91
|
- examples/echo_client.rb
|
93
92
|
- examples/echo_server.rb
|
94
93
|
- examples/google.rb
|
95
|
-
- examples/httpclient.rb
|
96
94
|
- ext/cool.io/.gitignore
|
97
95
|
- ext/cool.io/cool.io.h
|
98
96
|
- ext/cool.io/cool.io_ext.c
|
@@ -106,14 +104,6 @@ files:
|
|
106
104
|
- ext/cool.io/utils.c
|
107
105
|
- ext/cool.io/watcher.c
|
108
106
|
- ext/cool.io/watcher.h
|
109
|
-
- ext/http11_client/.gitignore
|
110
|
-
- ext/http11_client/LICENSE
|
111
|
-
- ext/http11_client/ext_help.h
|
112
|
-
- ext/http11_client/extconf.rb
|
113
|
-
- ext/http11_client/http11_client.c
|
114
|
-
- ext/http11_client/http11_parser.c
|
115
|
-
- ext/http11_client/http11_parser.h
|
116
|
-
- ext/http11_client/http11_parser.rl
|
117
107
|
- ext/iobuffer/extconf.rb
|
118
108
|
- ext/iobuffer/iobuffer.c
|
119
109
|
- ext/libev/Changes
|
@@ -132,14 +122,19 @@ files:
|
|
132
122
|
- ext/libev/ev_wrap.h
|
133
123
|
- ext/libev/ruby_gil.patch
|
134
124
|
- ext/libev/test_libev_win32.c
|
125
|
+
- ext/libev/win_select.patch
|
135
126
|
- lib/.gitignore
|
127
|
+
- lib/2.0/cool.io_ext.so
|
128
|
+
- lib/2.0/iobuffer_ext.so
|
129
|
+
- lib/2.1/cool.io_ext.so
|
130
|
+
- lib/2.1/iobuffer_ext.so
|
131
|
+
- lib/2.2/cool.io_ext.so
|
132
|
+
- lib/2.2/iobuffer_ext.so
|
136
133
|
- lib/cool.io.rb
|
137
134
|
- lib/cool.io/async_watcher.rb
|
138
135
|
- lib/cool.io/custom_require.rb
|
139
136
|
- lib/cool.io/dns_resolver.rb
|
140
137
|
- lib/cool.io/dsl.rb
|
141
|
-
- lib/cool.io/eventmachine.rb
|
142
|
-
- lib/cool.io/http_client.rb
|
143
138
|
- lib/cool.io/io.rb
|
144
139
|
- lib/cool.io/iowatcher.rb
|
145
140
|
- lib/cool.io/listener.rb
|
@@ -152,51 +147,36 @@ files:
|
|
152
147
|
- lib/coolio.rb
|
153
148
|
- spec/async_watcher_spec.rb
|
154
149
|
- spec/dns_spec.rb
|
150
|
+
- spec/iobuffer_spec.rb
|
155
151
|
- spec/spec_helper.rb
|
156
152
|
- spec/stat_watcher_spec.rb
|
157
153
|
- spec/tcp_server_spec.rb
|
154
|
+
- spec/tcp_socket_spec.rb
|
158
155
|
- spec/timer_watcher_spec.rb
|
156
|
+
- spec/udp_socket_spec.rb
|
159
157
|
- spec/unix_listener_spec.rb
|
160
158
|
- spec/unix_server_spec.rb
|
161
|
-
- lib/1.9/iobuffer_ext.so
|
162
|
-
- lib/2.0/iobuffer_ext.so
|
163
|
-
- lib/1.9/http11_client.so
|
164
|
-
- lib/2.0/http11_client.so
|
165
|
-
- lib/1.9/cool.io_ext.so
|
166
|
-
- lib/2.0/cool.io_ext.so
|
167
|
-
has_rdoc: true
|
168
159
|
homepage: http://coolio.github.com
|
169
160
|
licenses: []
|
170
|
-
|
161
|
+
metadata: {}
|
171
162
|
post_install_message:
|
172
163
|
rdoc_options: []
|
173
|
-
|
174
|
-
require_paths:
|
164
|
+
require_paths:
|
175
165
|
- lib
|
176
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
177
|
-
|
178
|
-
requirements:
|
166
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
179
168
|
- - ">="
|
180
|
-
- !ruby/object:Gem::Version
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
version: "0"
|
185
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
|
-
none: false
|
187
|
-
requirements:
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
171
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
188
173
|
- - ">="
|
189
|
-
- !ruby/object:Gem::Version
|
190
|
-
|
191
|
-
segments:
|
192
|
-
- 0
|
193
|
-
version: "0"
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
194
176
|
requirements: []
|
195
|
-
|
196
177
|
rubyforge_project:
|
197
|
-
rubygems_version:
|
178
|
+
rubygems_version: 2.4.8
|
198
179
|
signing_key:
|
199
|
-
specification_version:
|
180
|
+
specification_version: 4
|
200
181
|
summary: A cool framework for doing high performance I/O in Ruby
|
201
182
|
test_files: []
|
202
|
-
|