nio4r 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.md +4 -0
- data/README.md +1 -1
- data/ext/nio4r/selector.c +7 -1
- data/lib/nio/version.rb +1 -1
- data/lib/nio.rb +3 -1
- data/nio4r.gemspec +7 -1
- metadata +30 -9
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
New IO for Ruby
|
2
2
|
===============
|
3
|
-
[![Build Status](
|
3
|
+
[![Build Status](https://secure.travis-ci.org/tarcieri/nio4r.png?branch=master)](http://travis-ci.org/tarcieri/nio4r)
|
4
4
|
|
5
5
|
When it comes to managing many IO objects on Ruby, there aren't a whole lot of
|
6
6
|
options. The most powerful API Ruby itself gives you is Kernel.select, and
|
data/ext/nio4r/selector.c
CHANGED
@@ -36,6 +36,8 @@ static VALUE NIO_Selector_unlock(VALUE lock);
|
|
36
36
|
static VALUE NIO_Selector_register_synchronized(VALUE *args);
|
37
37
|
static VALUE NIO_Selector_deregister_synchronized(VALUE *args);
|
38
38
|
static VALUE NIO_Selector_select_synchronized(VALUE *args);
|
39
|
+
static VALUE NIO_Selector_close_synchronized(VALUE self);
|
40
|
+
|
39
41
|
static int NIO_Selector_run(struct NIO_Selector *selector, VALUE timeout);
|
40
42
|
static void NIO_Selector_timeout_callback(struct ev_loop *ev_loop, struct ev_timer *timer, int revents);
|
41
43
|
static void NIO_Selector_wakeup_callback(struct ev_loop *ev_loop, struct ev_io *io, int revents);
|
@@ -389,7 +391,11 @@ static VALUE NIO_Selector_close(VALUE self)
|
|
389
391
|
/* Is the selector closed? */
|
390
392
|
static VALUE NIO_Selector_closed(VALUE self)
|
391
393
|
{
|
392
|
-
|
394
|
+
return NIO_Selector_synchronize(self, NIO_Selector_close_synchronized, self);
|
395
|
+
}
|
396
|
+
|
397
|
+
static VALUE NIO_Selector_close_synchronized(VALUE self)
|
398
|
+
{ struct NIO_Selector *selector;
|
393
399
|
Data_Get_Struct(self, struct NIO_Selector, selector);
|
394
400
|
|
395
401
|
return selector->closed ? Qtrue : Qfalse;
|
data/lib/nio/version.rb
CHANGED
data/lib/nio.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'thread'
|
2
|
+
require 'socket'
|
2
3
|
require 'nio/version'
|
3
4
|
|
4
5
|
# New I/O for Ruby
|
@@ -19,9 +20,10 @@ else
|
|
19
20
|
|
20
21
|
if defined?(JRUBY_VERSION)
|
21
22
|
require 'java'
|
23
|
+
require 'jruby'
|
22
24
|
org.nio4r.Nio4r.new.load(JRuby.runtime, false)
|
23
25
|
NIO::ENGINE = 'java'
|
24
26
|
else
|
25
27
|
NIO::ENGINE = 'libev'
|
26
28
|
end
|
27
|
-
end
|
29
|
+
end
|
data/nio4r.gemspec
CHANGED
@@ -14,7 +14,13 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.name = "nio4r"
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = NIO::VERSION
|
17
|
-
|
17
|
+
|
18
|
+
if defined? JRUBY_VERSION
|
19
|
+
gem.files << "lib/nio4r_ext.jar"
|
20
|
+
gem.platform = "java"
|
21
|
+
else
|
22
|
+
gem.extensions = ["ext/nio4r/extconf.rb"]
|
23
|
+
end
|
18
24
|
|
19
25
|
gem.add_development_dependency "rake-compiler"
|
20
26
|
gem.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nio4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rake
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: rspec
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,7 +53,12 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
description: New IO for Ruby
|
48
63
|
email:
|
49
64
|
- tony.arcieri@gmail.com
|
@@ -111,15 +126,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
126
|
- - ! '>='
|
112
127
|
- !ruby/object:Gem::Version
|
113
128
|
version: '0'
|
129
|
+
segments:
|
130
|
+
- 0
|
131
|
+
hash: 2154301521891928871
|
114
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
133
|
none: false
|
116
134
|
requirements:
|
117
135
|
- - ! '>='
|
118
136
|
- !ruby/object:Gem::Version
|
119
137
|
version: '0'
|
138
|
+
segments:
|
139
|
+
- 0
|
140
|
+
hash: 2154301521891928871
|
120
141
|
requirements: []
|
121
142
|
rubyforge_project:
|
122
|
-
rubygems_version: 1.8.
|
143
|
+
rubygems_version: 1.8.24
|
123
144
|
signing_key:
|
124
145
|
specification_version: 3
|
125
146
|
summary: NIO provides a high performance selector API for monitoring IO objects
|