nio4r 1.1.0 → 1.2.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +61 -0
- data/.rubocop_todo.yml +35 -0
- data/.travis.yml +11 -1
- data/CHANGES.md +13 -0
- data/Gemfile +2 -2
- data/Rakefile +1 -1
- data/examples/echo_server.rb +6 -7
- data/ext/libev/Changes +16 -1
- data/ext/libev/ev.c +339 -141
- data/ext/libev/ev.h +14 -7
- data/ext/libev/ev_epoll.c +2 -2
- data/ext/libev/ev_win32.c +2 -3
- data/ext/nio4r/extconf.rb +23 -34
- data/ext/nio4r/monitor.c +38 -2
- data/ext/nio4r/org/nio4r/Nio4r.java +35 -0
- data/ext/nio4r/selector.c +11 -0
- data/lib/nio/monitor.rb +16 -4
- data/lib/nio/selector.rb +14 -15
- data/lib/nio/version.rb +1 -1
- data/lib/nio.rb +15 -13
- data/nio4r.gemspec +4 -3
- data/spec/nio/acceptables_spec.rb +3 -3
- data/spec/nio/monitor_spec.rb +52 -8
- data/spec/nio/selectables/pipe_spec.rb +5 -5
- data/spec/nio/selectables/ssl_socket_spec.rb +12 -12
- data/spec/nio/selectables/tcp_socket_spec.rb +8 -8
- data/spec/nio/selectables/udp_socket_spec.rb +6 -6
- data/spec/nio/selector_spec.rb +10 -4
- data/spec/spec_helper.rb +7 -5
- data/spec/support/selectable_examples.rb +5 -5
- data/tasks/extension.rake +7 -7
- data/tasks/rspec.rake +2 -2
- data/tasks/rubocop.rake +3 -0
- metadata +22 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 339fc3cc040e41d266a9f83ab155d903294fcdc5
|
|
4
|
+
data.tar.gz: 8872185b3bfadc884b36b65ea1a17a2c082d7090
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73083b74bdcb581449b5b0534209fdd9b1c08059ee946eaf9f8155d72605030c127046a7819d4ed325e0bf3e525c4aec81a41c00b55077f9e5b4629dd147d931
|
|
7
|
+
data.tar.gz: 44eb8368129b34cfb8780b98334ff8a67029d1751fdfc756ee761cb19c975f55a95c5166a251dba88ea7f587a3441f19650dcb13d936d88c60f847bda9c20d1d
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Deliberate style choices
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
LineLength:
|
|
6
|
+
Max: 100
|
|
7
|
+
|
|
8
|
+
Style/StringLiterals:
|
|
9
|
+
EnforcedStyle: double_quotes
|
|
10
|
+
|
|
11
|
+
Metrics/MethodLength:
|
|
12
|
+
CountComments: false
|
|
13
|
+
Max: 40
|
|
14
|
+
|
|
15
|
+
Metrics/AbcSize:
|
|
16
|
+
Max: 40
|
|
17
|
+
|
|
18
|
+
Metrics/PerceivedComplexity:
|
|
19
|
+
Max: 15
|
|
20
|
+
|
|
21
|
+
Metrics/CyclomaticComplexity:
|
|
22
|
+
Max: 10
|
|
23
|
+
|
|
24
|
+
Style/GlobalVars:
|
|
25
|
+
Enabled: false
|
|
26
|
+
|
|
27
|
+
Style/TrivialAccessors:
|
|
28
|
+
Enabled: false
|
|
29
|
+
|
|
30
|
+
#
|
|
31
|
+
# Auto-generated overrides
|
|
32
|
+
#
|
|
33
|
+
|
|
34
|
+
# Offense count: 2
|
|
35
|
+
Lint/HandleExceptions:
|
|
36
|
+
Enabled: false
|
|
37
|
+
|
|
38
|
+
# Offense count: 3
|
|
39
|
+
Lint/Loop:
|
|
40
|
+
Enabled: false
|
|
41
|
+
|
|
42
|
+
# Offense count: 1
|
|
43
|
+
Lint/NonLocalExitFromIterator:
|
|
44
|
+
Enabled: false
|
|
45
|
+
|
|
46
|
+
# Offense count: 7
|
|
47
|
+
Lint/UselessAssignment:
|
|
48
|
+
Enabled: false
|
|
49
|
+
|
|
50
|
+
# Offense count: 1
|
|
51
|
+
# Configuration parameters: SupportedStyles, IndentOneStep.
|
|
52
|
+
Style/CaseIndentation:
|
|
53
|
+
IndentWhenRelativeTo: end
|
|
54
|
+
|
|
55
|
+
# Offense count: 1
|
|
56
|
+
Style/Documentation:
|
|
57
|
+
Enabled: false
|
|
58
|
+
|
|
59
|
+
# Offense count: 2
|
|
60
|
+
Style/RescueModifier:
|
|
61
|
+
Enabled: false
|
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
|
2
|
+
# on 2015-04-24 03:08:21 -0700 using RuboCop version 0.30.1.
|
|
3
|
+
# The point is for the user to remove these configuration records
|
|
4
|
+
# one by one as the offenses are removed from the code base.
|
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
|
7
|
+
|
|
8
|
+
# Offense count: 2
|
|
9
|
+
Lint/HandleExceptions:
|
|
10
|
+
Enabled: false
|
|
11
|
+
|
|
12
|
+
# Offense count: 3
|
|
13
|
+
Lint/Loop:
|
|
14
|
+
Enabled: false
|
|
15
|
+
|
|
16
|
+
# Offense count: 1
|
|
17
|
+
Lint/NonLocalExitFromIterator:
|
|
18
|
+
Enabled: false
|
|
19
|
+
|
|
20
|
+
# Offense count: 7
|
|
21
|
+
Lint/UselessAssignment:
|
|
22
|
+
Enabled: false
|
|
23
|
+
|
|
24
|
+
# Offense count: 1
|
|
25
|
+
# Configuration parameters: SupportedStyles, IndentOneStep.
|
|
26
|
+
Style/CaseIndentation:
|
|
27
|
+
IndentWhenRelativeTo: end
|
|
28
|
+
|
|
29
|
+
# Offense count: 1
|
|
30
|
+
Style/Documentation:
|
|
31
|
+
Enabled: false
|
|
32
|
+
|
|
33
|
+
# Offense count: 2
|
|
34
|
+
Style/RescueModifier:
|
|
35
|
+
Enabled: false
|
data/.travis.yml
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
|
+
language: ruby
|
|
2
|
+
sudo: false
|
|
3
|
+
|
|
1
4
|
rvm:
|
|
2
|
-
- 1.9.3
|
|
3
5
|
- 2.0.0
|
|
4
6
|
- 2.1.1
|
|
7
|
+
- 2.2.2
|
|
5
8
|
- ruby-head
|
|
6
9
|
- jruby
|
|
7
10
|
- jruby-head
|
|
8
11
|
- rbx-2
|
|
9
12
|
|
|
13
|
+
env:
|
|
14
|
+
- NIO4R_PURE=false
|
|
15
|
+
- NIO4R_PURE=true
|
|
16
|
+
|
|
10
17
|
matrix:
|
|
18
|
+
fast_finish: true
|
|
11
19
|
allow_failures:
|
|
12
20
|
- rvm: ruby-head
|
|
13
21
|
- rvm: jruby-head
|
|
14
22
|
- rvm: rbx-2
|
|
23
|
+
- rvm: jruby
|
|
24
|
+
env: NIO4R_PURE=true
|
|
15
25
|
|
|
16
26
|
notifications:
|
|
17
27
|
irc: "irc.freenode.org#celluloid"
|
data/CHANGES.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
1.2.0 (2015-12-22)
|
|
2
|
+
------------------
|
|
3
|
+
* Add NIO::Monitor#interests= API for changing interests. Contributed by
|
|
4
|
+
@UpeksheJay as a Google Summer of Code project.
|
|
5
|
+
* Update to libev 4.22
|
|
6
|
+
|
|
7
|
+
1.1.1 (2015-07-17)
|
|
8
|
+
------------------
|
|
9
|
+
* Update to libev 4.20
|
|
10
|
+
* Fall back to io.h if unistd.h is not found
|
|
11
|
+
* RSpec updates
|
|
12
|
+
* RuboCop
|
|
13
|
+
|
|
1
14
|
1.1.0 (2015-01-10)
|
|
2
15
|
------------------
|
|
3
16
|
* Update to libev 4.19
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/examples/echo_server.rb
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
require
|
|
5
|
-
require
|
|
3
|
+
$LOAD_PATH.push File.expand_path("../../lib", __FILE__)
|
|
4
|
+
require "nio"
|
|
5
|
+
require "socket"
|
|
6
6
|
|
|
7
|
+
# Echo server example written with nio4r
|
|
7
8
|
class EchoServer
|
|
8
9
|
def initialize(host, port)
|
|
9
10
|
@selector = NIO::Selector.new
|
|
@@ -16,7 +17,7 @@ class EchoServer
|
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def run
|
|
19
|
-
|
|
20
|
+
loop do
|
|
20
21
|
@selector.select { |monitor| monitor.value.call(monitor) }
|
|
21
22
|
end
|
|
22
23
|
end
|
|
@@ -42,6 +43,4 @@ class EchoServer
|
|
|
42
43
|
end
|
|
43
44
|
end
|
|
44
45
|
|
|
45
|
-
if $
|
|
46
|
-
EchoServer.new("localhost", 1234).run
|
|
47
|
-
end
|
|
46
|
+
EchoServer.new("localhost", 1234).run if $PROGRAM_NAME == __FILE__
|
data/ext/libev/Changes
CHANGED
|
@@ -12,9 +12,24 @@ TODO: document file descriptor usage per loop
|
|
|
12
12
|
TODO: store loop pid_t and compare isndie signal handler,store 1 for same, 2 for differign pid, clean up in loop_fork
|
|
13
13
|
TODO: embed watchers need updating when fd changes
|
|
14
14
|
TODO: document portability requirements for atomic pointer access
|
|
15
|
-
TODO: possible cb aliasing?
|
|
16
15
|
TODO: document requirements for function pointers and calling conventions.
|
|
17
16
|
|
|
17
|
+
4.22 Sun Dec 20 22:11:50 CET 2015
|
|
18
|
+
- when epoll detects unremovable fds in the fd set, rebuild
|
|
19
|
+
only the epoll descriptor, not the signal pipe, to avoid
|
|
20
|
+
SIGPIPE in ev_async_send. This doesn't solve it on fork,
|
|
21
|
+
so document what needs to be done in ev_loop_fork
|
|
22
|
+
(analyzed by Benjamin Mahler).
|
|
23
|
+
- remove superfluous sys/timeb.h include on win32
|
|
24
|
+
(analyzed by Jason Madden).
|
|
25
|
+
- updated libecb.
|
|
26
|
+
|
|
27
|
+
4.20 Sat Jun 20 13:01:43 CEST 2015
|
|
28
|
+
- prefer noexcept over throw () with C++ 11.
|
|
29
|
+
- update ecb.h due to incompatibilities with c11.
|
|
30
|
+
- fix a potential aliasing issue when reading and writing
|
|
31
|
+
watcher callbacks.
|
|
32
|
+
|
|
18
33
|
4.19 Thu Sep 25 08:18:25 CEST 2014
|
|
19
34
|
- ev.h wasn't valid C++ anymore, which tripped compilers other than
|
|
20
35
|
clang, msvc or gcc (analyzed by Raphael 'kena' Poss). Unfortunately,
|