nio4r 2.5.8-java → 2.6.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/workflow.yml +33 -19
- data/Gemfile +1 -2
- data/{CHANGES.md → changes.md} +23 -0
- data/ext/nio4r/bytebuffer.c +29 -10
- data/ext/nio4r/extconf.rb +5 -1
- data/ext/nio4r/monitor.c +16 -5
- data/ext/nio4r/nio4r.h +0 -6
- data/ext/nio4r/selector.c +29 -30
- data/lib/nio/version.rb +1 -1
- data/lib/nio4r.rb +1 -0
- data/lib/nio4r_ext.jar +0 -0
- data/license.md +66 -0
- data/rakelib/extension.rake +1 -2
- data/{README.md → readme.md} +9 -34
- data/spec/nio/selectables/ssl_socket_spec.rb +1 -3
- data/spec/spec_helper.rb +0 -3
- metadata +11 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa7ff0bd09ef7e889ab134788e01d7adee76d918828a04770b7870218b5d4209
|
4
|
+
data.tar.gz: 7e86a3c72cbc429069af232f7e01b526135a1d0318ff5ed26ed17fada28529cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz: '
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0900a204af3c7da49f8f1e8752f91b611edaa5c7520cd5abd338c42018de9a543cc3ca9fd95134a2d22d1e71f6739e5908122a93638ca4fcbe42879a5217ce2a'
|
7
|
+
data.tar.gz: 53123e588d68838ce473aeae69891d1d54321e934df358421f40238485cc3881286b89f839cb7634c75cd65e50592eabf8d2d026a26bf627a35fa1c9c5b2587d
|
@@ -14,34 +14,48 @@ jobs:
|
|
14
14
|
strategy:
|
15
15
|
fail-fast: false
|
16
16
|
matrix:
|
17
|
-
os:
|
18
|
-
|
17
|
+
os:
|
18
|
+
- ubuntu-22.04
|
19
|
+
- macos-11
|
20
|
+
- windows-2022
|
21
|
+
ruby:
|
22
|
+
- "2.4"
|
23
|
+
- "2.5"
|
24
|
+
- "2.6"
|
25
|
+
- "2.7"
|
26
|
+
- "3.0"
|
27
|
+
- "3.1"
|
28
|
+
- "3.2"
|
29
|
+
- "head"
|
30
|
+
- "jruby"
|
31
|
+
- "truffleruby"
|
19
32
|
include:
|
20
|
-
- {
|
21
|
-
- {
|
33
|
+
- {os: ubuntu-20.04, ruby: "3.2"}
|
34
|
+
- {os: windows-2019, ruby: "3.2"}
|
35
|
+
- {os: windows-2022, ruby: ucrt}
|
22
36
|
exclude:
|
23
|
-
- {
|
24
|
-
- {
|
25
|
-
- {
|
37
|
+
- {os: windows-2022, ruby: head}
|
38
|
+
- {os: windows-2022, ruby: jruby}
|
39
|
+
- {os: windows-2022, ruby: truffleruby}
|
26
40
|
|
27
41
|
steps:
|
28
|
-
-
|
29
|
-
uses: actions/checkout@v2
|
42
|
+
- uses: actions/checkout@v3
|
30
43
|
|
31
|
-
- name:
|
32
|
-
|
44
|
+
- name: set JAVA_HOME
|
45
|
+
if: |
|
46
|
+
startsWith(matrix.ruby, 'jruby')
|
47
|
+
shell: bash
|
48
|
+
run: |
|
49
|
+
echo JAVA_HOME=$JAVA_HOME_11_X64 >> $GITHUB_ENV
|
50
|
+
|
51
|
+
- uses: ruby/setup-ruby@v1
|
33
52
|
with:
|
34
53
|
ruby-version: ${{matrix.ruby}}
|
54
|
+
bundler-cache: true
|
35
55
|
|
36
|
-
- name:
|
37
|
-
run: gem update --system --no-document --conservative
|
38
|
-
|
39
|
-
- name: bundle install
|
40
|
-
run: bundle install --path .bundle/gems --without development
|
41
|
-
|
42
|
-
- name: compile
|
56
|
+
- name: Compile
|
43
57
|
run: bundle exec rake compile
|
44
58
|
|
45
|
-
- name:
|
59
|
+
- name: Test
|
46
60
|
run: bundle exec rake spec
|
47
61
|
timeout-minutes: 10
|
data/Gemfile
CHANGED
@@ -11,8 +11,7 @@ group :development do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
group :development, :test do
|
14
|
-
gem "
|
15
|
-
gem "rake-compiler", require: false
|
14
|
+
gem "rake-compiler", "~> 1.1.9", require: false
|
16
15
|
gem "rspec", "~> 3.7", require: false
|
17
16
|
gem "rubocop", "0.82.0", require: false
|
18
17
|
end
|
data/{CHANGES.md → changes.md}
RENAMED
@@ -1,3 +1,26 @@
|
|
1
|
+
## 2.5.9 (2023-04-02)
|
2
|
+
|
3
|
+
https://github.com/socketry/nio4r/compare/v2.5.8..v2.5.9
|
4
|
+
|
5
|
+
## 2.5.8 (2021-08-03)
|
6
|
+
|
7
|
+
* [#276](https://github.com/socketry/nio4r/pull/276)
|
8
|
+
Fix missing return statement in function returning non-void (issue [#275](https://github.com/socketry/nio4r/pull/275))
|
9
|
+
([@ioquatix])
|
10
|
+
* Remove `guard-rspec` from development dependencies ([@ioquatix])
|
11
|
+
|
12
|
+
## 2.5.7 (2021-03-04)
|
13
|
+
|
14
|
+
* [#267](https://github.com/socketry/nio4r/pull/267)
|
15
|
+
Don't try to link universal extension
|
16
|
+
([@ioquatix])
|
17
|
+
|
18
|
+
## 2.5.6 (2021-03-04)
|
19
|
+
|
20
|
+
* [#268](https://github.com/socketry/nio4r/pull/268)
|
21
|
+
Prefer kqueue when on OSX >= v10.12.2
|
22
|
+
([@jcmfernandes])
|
23
|
+
|
1
24
|
## 2.5.5 (2021-02-05)
|
2
25
|
|
3
26
|
* [#256](https://github.com/socketry/nio4r/pull/256)
|
data/ext/nio4r/bytebuffer.c
CHANGED
@@ -36,6 +36,26 @@ static VALUE NIO_ByteBuffer_inspect(VALUE self);
|
|
36
36
|
|
37
37
|
#define MARK_UNSET -1
|
38
38
|
|
39
|
+
/* Compatibility for Ruby <= 3.1 */
|
40
|
+
#ifndef HAVE_RB_IO_DESCRIPTOR
|
41
|
+
static int
|
42
|
+
io_descriptor_fallback(VALUE io)
|
43
|
+
{
|
44
|
+
rb_io_t *fptr;
|
45
|
+
GetOpenFile(io, fptr);
|
46
|
+
return fptr->fd;
|
47
|
+
}
|
48
|
+
#define rb_io_descriptor io_descriptor_fallback
|
49
|
+
#endif
|
50
|
+
|
51
|
+
static void
|
52
|
+
io_set_nonblock(VALUE io)
|
53
|
+
{
|
54
|
+
rb_io_t *fptr;
|
55
|
+
GetOpenFile(io, fptr);
|
56
|
+
rb_io_set_nonblock(fptr);
|
57
|
+
}
|
58
|
+
|
39
59
|
void Init_NIO_ByteBuffer()
|
40
60
|
{
|
41
61
|
mNIO = rb_define_module("NIO");
|
@@ -281,19 +301,19 @@ static VALUE NIO_ByteBuffer_put(VALUE self, VALUE string)
|
|
281
301
|
static VALUE NIO_ByteBuffer_read_from(VALUE self, VALUE io)
|
282
302
|
{
|
283
303
|
struct NIO_ByteBuffer *buffer;
|
284
|
-
rb_io_t *fptr;
|
285
304
|
ssize_t nbytes, bytes_read;
|
286
305
|
|
287
306
|
Data_Get_Struct(self, struct NIO_ByteBuffer, buffer);
|
288
|
-
|
289
|
-
|
307
|
+
|
308
|
+
io = rb_convert_type(io, T_FILE, "IO", "to_io");
|
309
|
+
io_set_nonblock(io);
|
290
310
|
|
291
311
|
nbytes = buffer->limit - buffer->position;
|
292
312
|
if (nbytes == 0) {
|
293
313
|
rb_raise(cNIO_ByteBuffer_OverflowError, "buffer is full");
|
294
314
|
}
|
295
315
|
|
296
|
-
bytes_read = read(
|
316
|
+
bytes_read = read(rb_io_descriptor(io), buffer->buffer + buffer->position, nbytes);
|
297
317
|
|
298
318
|
if (bytes_read < 0) {
|
299
319
|
if (errno == EAGAIN) {
|
@@ -305,25 +325,24 @@ static VALUE NIO_ByteBuffer_read_from(VALUE self, VALUE io)
|
|
305
325
|
|
306
326
|
buffer->position += bytes_read;
|
307
327
|
|
308
|
-
return
|
328
|
+
return SIZET2NUM(bytes_read);
|
309
329
|
}
|
310
330
|
|
311
331
|
static VALUE NIO_ByteBuffer_write_to(VALUE self, VALUE io)
|
312
332
|
{
|
313
333
|
struct NIO_ByteBuffer *buffer;
|
314
|
-
rb_io_t *fptr;
|
315
334
|
ssize_t nbytes, bytes_written;
|
316
335
|
|
317
336
|
Data_Get_Struct(self, struct NIO_ByteBuffer, buffer);
|
318
|
-
|
319
|
-
|
337
|
+
io = rb_convert_type(io, T_FILE, "IO", "to_io");
|
338
|
+
io_set_nonblock(io);
|
320
339
|
|
321
340
|
nbytes = buffer->limit - buffer->position;
|
322
341
|
if (nbytes == 0) {
|
323
342
|
rb_raise(cNIO_ByteBuffer_UnderflowError, "no data remaining in buffer");
|
324
343
|
}
|
325
344
|
|
326
|
-
bytes_written = write(
|
345
|
+
bytes_written = write(rb_io_descriptor(io), buffer->buffer + buffer->position, nbytes);
|
327
346
|
|
328
347
|
if (bytes_written < 0) {
|
329
348
|
if (errno == EAGAIN) {
|
@@ -335,7 +354,7 @@ static VALUE NIO_ByteBuffer_write_to(VALUE self, VALUE io)
|
|
335
354
|
|
336
355
|
buffer->position += bytes_written;
|
337
356
|
|
338
|
-
return
|
357
|
+
return SIZET2NUM(bytes_written);
|
339
358
|
}
|
340
359
|
|
341
360
|
static VALUE NIO_ByteBuffer_flip(VALUE self)
|
data/ext/nio4r/extconf.rb
CHANGED
@@ -4,7 +4,10 @@ require "rubygems"
|
|
4
4
|
|
5
5
|
# Write a dummy Makefile on Windows because we use the pure Ruby implementation there
|
6
6
|
if Gem.win_platform?
|
7
|
-
|
7
|
+
begin
|
8
|
+
require "devkit" if RUBY_PLATFORM.include?("mingw")
|
9
|
+
rescue LoadError => e
|
10
|
+
end
|
8
11
|
File.write("Makefile", "all install::\n")
|
9
12
|
File.write("nio4r_ext.so", "")
|
10
13
|
exit
|
@@ -13,6 +16,7 @@ end
|
|
13
16
|
require "mkmf"
|
14
17
|
|
15
18
|
have_header("unistd.h")
|
19
|
+
have_func("rb_io_descriptor")
|
16
20
|
|
17
21
|
$defs << "-DEV_USE_LINUXAIO" if have_header("linux/aio_abi.h")
|
18
22
|
$defs << "-DEV_USE_IOURING" if have_header("linux/io_uring.h")
|
data/ext/nio4r/monitor.c
CHANGED
@@ -34,6 +34,18 @@ static VALUE NIO_Monitor_readiness(VALUE self);
|
|
34
34
|
static int NIO_Monitor_symbol2interest(VALUE interests);
|
35
35
|
static void NIO_Monitor_update_interests(VALUE self, int interests);
|
36
36
|
|
37
|
+
/* Compatibility for Ruby <= 3.1 */
|
38
|
+
#ifndef HAVE_RB_IO_DESCRIPTOR
|
39
|
+
static int
|
40
|
+
io_descriptor_fallback(VALUE io)
|
41
|
+
{
|
42
|
+
rb_io_t *fptr;
|
43
|
+
GetOpenFile(io, fptr);
|
44
|
+
return fptr->fd;
|
45
|
+
}
|
46
|
+
#define rb_io_descriptor io_descriptor_fallback
|
47
|
+
#endif
|
48
|
+
|
37
49
|
/* Monitor control how a channel is being waited for by a monitor */
|
38
50
|
void Init_NIO_Monitor()
|
39
51
|
{
|
@@ -81,7 +93,6 @@ static VALUE NIO_Monitor_initialize(VALUE self, VALUE io, VALUE interests, VALUE
|
|
81
93
|
struct NIO_Monitor *monitor;
|
82
94
|
struct NIO_Selector *selector;
|
83
95
|
ID interests_id;
|
84
|
-
rb_io_t *fptr;
|
85
96
|
|
86
97
|
interests_id = SYM2ID(interests);
|
87
98
|
|
@@ -97,8 +108,8 @@ static VALUE NIO_Monitor_initialize(VALUE self, VALUE io, VALUE interests, VALUE
|
|
97
108
|
rb_raise(rb_eArgError, "invalid event type %s (must be :r, :w, or :rw)", RSTRING_PTR(rb_funcall(interests, rb_intern("inspect"), 0)));
|
98
109
|
}
|
99
110
|
|
100
|
-
|
101
|
-
ev_io_init(&monitor->ev_io, NIO_Selector_monitor_callback,
|
111
|
+
io = rb_convert_type(io, T_FILE, "IO", "to_io");
|
112
|
+
ev_io_init(&monitor->ev_io, NIO_Selector_monitor_callback, rb_io_descriptor(io), monitor->interests);
|
102
113
|
|
103
114
|
rb_ivar_set(self, rb_intern("io"), io);
|
104
115
|
rb_ivar_set(self, rb_intern("interests"), interests);
|
@@ -182,7 +193,7 @@ static VALUE NIO_Monitor_add_interest(VALUE self, VALUE interest)
|
|
182
193
|
Data_Get_Struct(self, struct NIO_Monitor, monitor);
|
183
194
|
|
184
195
|
interest = monitor->interests | NIO_Monitor_symbol2interest(interest);
|
185
|
-
NIO_Monitor_update_interests(self, interest);
|
196
|
+
NIO_Monitor_update_interests(self, (int)interest);
|
186
197
|
|
187
198
|
return rb_ivar_get(self, rb_intern("interests"));
|
188
199
|
}
|
@@ -193,7 +204,7 @@ static VALUE NIO_Monitor_remove_interest(VALUE self, VALUE interest)
|
|
193
204
|
Data_Get_Struct(self, struct NIO_Monitor, monitor);
|
194
205
|
|
195
206
|
interest = monitor->interests & ~NIO_Monitor_symbol2interest(interest);
|
196
|
-
NIO_Monitor_update_interests(self, interest);
|
207
|
+
NIO_Monitor_update_interests(self, (int)interest);
|
197
208
|
|
198
209
|
return rb_ivar_get(self, rb_intern("interests"));
|
199
210
|
}
|
data/ext/nio4r/nio4r.h
CHANGED
@@ -40,12 +40,6 @@ struct NIO_ByteBuffer {
|
|
40
40
|
int position, limit, capacity, mark;
|
41
41
|
};
|
42
42
|
|
43
|
-
#ifdef GetReadFile
|
44
|
-
#define FPTR_TO_FD(fptr) (fileno(GetReadFile(fptr)))
|
45
|
-
#else
|
46
|
-
#define FPTR_TO_FD(fptr) fptr->fd
|
47
|
-
#endif /* GetReadFile */
|
48
|
-
|
49
43
|
/* Thunk between libev callbacks in NIO::Monitors and NIO::Selectors */
|
50
44
|
void NIO_Selector_monitor_callback(struct ev_loop *ev_loop, struct ev_io *io, int revents);
|
51
45
|
|
data/ext/nio4r/selector.c
CHANGED
@@ -43,13 +43,13 @@ static VALUE NIO_Selector_closed(VALUE self);
|
|
43
43
|
static VALUE NIO_Selector_is_empty(VALUE self);
|
44
44
|
|
45
45
|
/* Internal functions */
|
46
|
-
static VALUE NIO_Selector_synchronize(VALUE self, VALUE (*func)(VALUE
|
46
|
+
static VALUE NIO_Selector_synchronize(VALUE self, VALUE (*func)(VALUE arg), VALUE arg);
|
47
47
|
static VALUE NIO_Selector_unlock(VALUE lock);
|
48
|
-
static VALUE NIO_Selector_register_synchronized(VALUE
|
49
|
-
static VALUE NIO_Selector_deregister_synchronized(VALUE
|
50
|
-
static VALUE NIO_Selector_select_synchronized(VALUE
|
51
|
-
static VALUE NIO_Selector_close_synchronized(VALUE
|
52
|
-
static VALUE NIO_Selector_closed_synchronized(VALUE
|
48
|
+
static VALUE NIO_Selector_register_synchronized(VALUE arg);
|
49
|
+
static VALUE NIO_Selector_deregister_synchronized(VALUE arg);
|
50
|
+
static VALUE NIO_Selector_select_synchronized(VALUE arg);
|
51
|
+
static VALUE NIO_Selector_close_synchronized(VALUE arg);
|
52
|
+
static VALUE NIO_Selector_closed_synchronized(VALUE arg);
|
53
53
|
|
54
54
|
static int NIO_Selector_run(struct NIO_Selector *selector, VALUE timeout);
|
55
55
|
static void NIO_Selector_timeout_callback(struct ev_loop *ev_loop, struct ev_timer *timer, int revents);
|
@@ -62,7 +62,7 @@ static void NIO_Selector_wakeup_callback(struct ev_loop *ev_loop, struct ev_io *
|
|
62
62
|
#define BUSYWAIT_INTERVAL 0.01
|
63
63
|
|
64
64
|
/* Selectors wait for events */
|
65
|
-
void Init_NIO_Selector()
|
65
|
+
void Init_NIO_Selector(void)
|
66
66
|
{
|
67
67
|
mNIO = rb_define_module("NIO");
|
68
68
|
cNIO_Selector = rb_define_class_under(mNIO, "Selector", rb_cObject);
|
@@ -285,7 +285,7 @@ static VALUE NIO_Selector_backend(VALUE self)
|
|
285
285
|
}
|
286
286
|
|
287
287
|
/* Synchronize around a reentrant selector lock */
|
288
|
-
static VALUE NIO_Selector_synchronize(VALUE self, VALUE (*func)(VALUE
|
288
|
+
static VALUE NIO_Selector_synchronize(VALUE self, VALUE (*func)(VALUE arg), VALUE arg)
|
289
289
|
{
|
290
290
|
VALUE current_thread, lock_holder, lock;
|
291
291
|
|
@@ -298,10 +298,10 @@ static VALUE NIO_Selector_synchronize(VALUE self, VALUE (*func)(VALUE *args), VA
|
|
298
298
|
rb_ivar_set(self, rb_intern("lock_holder"), current_thread);
|
299
299
|
|
300
300
|
/* We've acquired the lock, so ensure we unlock it */
|
301
|
-
return rb_ensure(func, (VALUE)
|
301
|
+
return rb_ensure(func, (VALUE)arg, NIO_Selector_unlock, self);
|
302
302
|
} else {
|
303
303
|
/* We already hold the selector lock, so no need to unlock it */
|
304
|
-
return func(
|
304
|
+
return func(arg);
|
305
305
|
}
|
306
306
|
}
|
307
307
|
|
@@ -321,17 +321,18 @@ static VALUE NIO_Selector_unlock(VALUE self)
|
|
321
321
|
/* Register an IO object with the selector for the given interests */
|
322
322
|
static VALUE NIO_Selector_register(VALUE self, VALUE io, VALUE interests)
|
323
323
|
{
|
324
|
-
VALUE args[3] = {
|
325
|
-
return NIO_Selector_synchronize(self, NIO_Selector_register_synchronized, args);
|
324
|
+
VALUE args[3] = {self, io, interests};
|
325
|
+
return NIO_Selector_synchronize(self, NIO_Selector_register_synchronized, (VALUE)args);
|
326
326
|
}
|
327
327
|
|
328
328
|
/* Internal implementation of register after acquiring mutex */
|
329
|
-
static VALUE NIO_Selector_register_synchronized(VALUE
|
329
|
+
static VALUE NIO_Selector_register_synchronized(VALUE _args)
|
330
330
|
{
|
331
331
|
VALUE self, io, interests, selectables, monitor;
|
332
332
|
VALUE monitor_args[3];
|
333
333
|
struct NIO_Selector *selector;
|
334
334
|
|
335
|
+
VALUE *args = (VALUE *)_args;
|
335
336
|
self = args[0];
|
336
337
|
io = args[1];
|
337
338
|
interests = args[2];
|
@@ -361,15 +362,16 @@ static VALUE NIO_Selector_register_synchronized(VALUE *args)
|
|
361
362
|
/* Deregister an IO object from the selector */
|
362
363
|
static VALUE NIO_Selector_deregister(VALUE self, VALUE io)
|
363
364
|
{
|
364
|
-
VALUE args[2] = {
|
365
|
-
return NIO_Selector_synchronize(self, NIO_Selector_deregister_synchronized, args);
|
365
|
+
VALUE args[2] = {self, io};
|
366
|
+
return NIO_Selector_synchronize(self, NIO_Selector_deregister_synchronized, (VALUE)args);
|
366
367
|
}
|
367
368
|
|
368
369
|
/* Internal implementation of register after acquiring mutex */
|
369
|
-
static VALUE NIO_Selector_deregister_synchronized(VALUE
|
370
|
+
static VALUE NIO_Selector_deregister_synchronized(VALUE _args)
|
370
371
|
{
|
371
372
|
VALUE self, io, selectables, monitor;
|
372
373
|
|
374
|
+
VALUE *args = (VALUE *)_args;
|
373
375
|
self = args[0];
|
374
376
|
io = args[1];
|
375
377
|
|
@@ -396,7 +398,6 @@ static VALUE NIO_Selector_is_registered(VALUE self, VALUE io)
|
|
396
398
|
static VALUE NIO_Selector_select(int argc, VALUE *argv, VALUE self)
|
397
399
|
{
|
398
400
|
VALUE timeout;
|
399
|
-
VALUE args[2];
|
400
401
|
|
401
402
|
rb_scan_args(argc, argv, "01", &timeout);
|
402
403
|
|
@@ -404,19 +405,19 @@ static VALUE NIO_Selector_select(int argc, VALUE *argv, VALUE self)
|
|
404
405
|
rb_raise(rb_eArgError, "time interval must be positive");
|
405
406
|
}
|
406
407
|
|
407
|
-
args[
|
408
|
-
|
409
|
-
|
410
|
-
return NIO_Selector_synchronize(self, NIO_Selector_select_synchronized, args);
|
408
|
+
VALUE args[2] = {self, timeout};
|
409
|
+
return NIO_Selector_synchronize(self, NIO_Selector_select_synchronized, (VALUE)args);
|
411
410
|
}
|
412
411
|
|
413
412
|
/* Internal implementation of select with the selector lock held */
|
414
|
-
static VALUE NIO_Selector_select_synchronized(VALUE
|
413
|
+
static VALUE NIO_Selector_select_synchronized(VALUE _args)
|
415
414
|
{
|
416
415
|
int ready;
|
417
416
|
VALUE ready_array;
|
418
417
|
struct NIO_Selector *selector;
|
419
418
|
|
419
|
+
VALUE *args = (VALUE *)_args;
|
420
|
+
|
420
421
|
Data_Get_Struct(args[0], struct NIO_Selector, selector);
|
421
422
|
|
422
423
|
if (selector->closed) {
|
@@ -504,14 +505,13 @@ static VALUE NIO_Selector_wakeup(VALUE self)
|
|
504
505
|
/* Close the selector and free system resources */
|
505
506
|
static VALUE NIO_Selector_close(VALUE self)
|
506
507
|
{
|
507
|
-
|
508
|
-
return NIO_Selector_synchronize(self, NIO_Selector_close_synchronized, args);
|
508
|
+
return NIO_Selector_synchronize(self, NIO_Selector_close_synchronized, self);
|
509
509
|
}
|
510
510
|
|
511
|
-
static VALUE NIO_Selector_close_synchronized(VALUE
|
511
|
+
static VALUE NIO_Selector_close_synchronized(VALUE self)
|
512
512
|
{
|
513
513
|
struct NIO_Selector *selector;
|
514
|
-
|
514
|
+
|
515
515
|
Data_Get_Struct(self, struct NIO_Selector, selector);
|
516
516
|
|
517
517
|
NIO_Selector_shutdown(selector);
|
@@ -522,14 +522,13 @@ static VALUE NIO_Selector_close_synchronized(VALUE *args)
|
|
522
522
|
/* Is the selector closed? */
|
523
523
|
static VALUE NIO_Selector_closed(VALUE self)
|
524
524
|
{
|
525
|
-
|
526
|
-
return NIO_Selector_synchronize(self, NIO_Selector_closed_synchronized, args);
|
525
|
+
return NIO_Selector_synchronize(self, NIO_Selector_closed_synchronized, self);
|
527
526
|
}
|
528
527
|
|
529
|
-
static VALUE NIO_Selector_closed_synchronized(VALUE
|
528
|
+
static VALUE NIO_Selector_closed_synchronized(VALUE self)
|
530
529
|
{
|
531
530
|
struct NIO_Selector *selector;
|
532
|
-
|
531
|
+
|
533
532
|
Data_Get_Struct(self, struct NIO_Selector, selector);
|
534
533
|
|
535
534
|
return selector->closed ? Qtrue : Qfalse;
|
data/lib/nio/version.rb
CHANGED
data/lib/nio4r.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require_relative "nio"
|
data/lib/nio4r_ext.jar
CHANGED
Binary file
|
data/license.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# MIT License
|
2
|
+
|
3
|
+
Copyright, 2011-2020, by Tony Arcieri.
|
4
|
+
Copyright, 2012, by Logan Bowers.
|
5
|
+
Copyright, 2013, by FURUHASHI Sadayuki.
|
6
|
+
Copyright, 2013, by Stephen von Takach.
|
7
|
+
Copyright, 2013, by Tim Carey-Smith.
|
8
|
+
Copyright, 2013, by brainopia.
|
9
|
+
Copyright, 2013, by Luis Lavena.
|
10
|
+
Copyright, 2014, by SHIBATA Hiroshi.
|
11
|
+
Copyright, 2014, by Sergey Avseyev.
|
12
|
+
Copyright, 2014, by JohnnyT.
|
13
|
+
Copyright, 2015-2017, by Tiago Cardoso.
|
14
|
+
Copyright, 2015, by Daniel Berger.
|
15
|
+
Copyright, 2015, by Upekshe.
|
16
|
+
Copyright, 2015-2016, by UpeksheJay.
|
17
|
+
Copyright, 2015, by Vladimir Kochnev.
|
18
|
+
Copyright, 2016-2018, by Jun Aruga.
|
19
|
+
Copyright, 2016, by Omer Katz.
|
20
|
+
Copyright, 2016-2021, by Olle Jonsson.
|
21
|
+
Copyright, 2017, by usa.
|
22
|
+
Copyright, 2017, by HoneyryderChuck.
|
23
|
+
Copyright, 2017, by tompng.
|
24
|
+
Copyright, 2018-2021, by Samuel Williams.
|
25
|
+
Copyright, 2019, by Cédric Boutillier.
|
26
|
+
Copyright, 2019-2020, by MSP-Greg.
|
27
|
+
Copyright, 2019-2020, by Benoit Daloze.
|
28
|
+
Copyright, 2019, by Jesús Burgos Maciá.
|
29
|
+
Copyright, 2019, by Thomas Kuntz.
|
30
|
+
Copyright, 2019, by Orien Madgwick.
|
31
|
+
Copyright, 2019, by Thomas Dziedzic.
|
32
|
+
Copyright, 2019, by Zhang Kang.
|
33
|
+
Copyright, 2020, by eladeyal-intel.
|
34
|
+
Copyright, 2020, by Pedro Paiva.
|
35
|
+
Copyright, 2020, by Bo.
|
36
|
+
Copyright, 2020, by Charles Oliver Nutter.
|
37
|
+
Copyright, 2020-2021, by Joao Fernandes.
|
38
|
+
Copyright, 2021, by Jun Jiang.
|
39
|
+
Copyright, 2021, by Jeffrey Martin.
|
40
|
+
Copyright, 2021, by Pavel Lobashov.
|
41
|
+
|
42
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
43
|
+
of this software and associated documentation files (the "Software"), to deal
|
44
|
+
in the Software without restriction, including without limitation the rights
|
45
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
46
|
+
copies of the Software, and to permit persons to whom the Software is
|
47
|
+
furnished to do so, subject to the following conditions:
|
48
|
+
|
49
|
+
The above copyright notice and this permission notice shall be included in all
|
50
|
+
copies or substantial portions of the Software.
|
51
|
+
|
52
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
53
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
54
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
55
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
56
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
57
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
58
|
+
SOFTWARE.
|
59
|
+
|
60
|
+
## libev
|
61
|
+
|
62
|
+
Released under the BSD license. See [ext/libev/LICENSE] for details.
|
63
|
+
|
64
|
+
Copyright, 2007-2019, by Marc Alexander Lehmann.
|
65
|
+
|
66
|
+
[ext/libev/LICENSE]: https://github.com/socketry/nio4r/blob/master/ext/libev/LICENSE
|
data/rakelib/extension.rake
CHANGED
data/{README.md → readme.md}
RENAMED
@@ -3,7 +3,6 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/nio4r.svg)](http://rubygems.org/gems/nio4r)
|
4
4
|
[![Build Status](https://github.com/socketry/nio4r/workflows/nio4r/badge.svg?branch=master&event=push)](https://github.com/socketry/nio4r/actions?query=workflow:nio4r)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/socketry/nio4r.svg)](https://codeclimate.com/github/socketry/nio4r)
|
6
|
-
[![Coverage Status](https://coveralls.io/repos/socketry/nio4r/badge.svg?branch=master)](https://coveralls.io/r/socketry/nio4r)
|
7
6
|
[![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/nio4r/2.2.0)
|
8
7
|
|
9
8
|
**New I/O for Ruby (nio4r)**: cross-platform asynchronous I/O primitives for
|
@@ -94,40 +93,16 @@ rake release
|
|
94
93
|
You might need to delete `Gemfile.lock` before trying to `bundle install`.
|
95
94
|
|
96
95
|
```
|
96
|
+
# Ensure you have the correct JDK:
|
97
|
+
pacman -Syu jdk-openjdk
|
98
|
+
archlinux-java set java-19-openjdk
|
99
|
+
|
100
|
+
# Ensure you are using jruby:
|
101
|
+
chruby jruby
|
102
|
+
bundle update
|
103
|
+
|
104
|
+
# Build the package:
|
97
105
|
rake clean
|
98
106
|
rake compile
|
99
107
|
rake release
|
100
108
|
```
|
101
|
-
|
102
|
-
## License
|
103
|
-
|
104
|
-
Released under the MIT license.
|
105
|
-
|
106
|
-
Copyright, 2019, by Tony Arcieri.
|
107
|
-
Copyright, 2019, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
|
108
|
-
|
109
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
110
|
-
of this software and associated documentation files (the "Software"), to deal
|
111
|
-
in the Software without restriction, including without limitation the rights
|
112
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
113
|
-
copies of the Software, and to permit persons to whom the Software is
|
114
|
-
furnished to do so, subject to the following conditions:
|
115
|
-
|
116
|
-
The above copyright notice and this permission notice shall be included in
|
117
|
-
all copies or substantial portions of the Software.
|
118
|
-
|
119
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
120
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
121
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
122
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
123
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
124
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
125
|
-
THE SOFTWARE.
|
126
|
-
|
127
|
-
### libev
|
128
|
-
|
129
|
-
Released under the BSD license. See [ext/libev/LICENSE] for details.
|
130
|
-
|
131
|
-
Copyright, 2007-2019, by Marc Alexander Lehmann.
|
132
|
-
|
133
|
-
[ext/libev/LICENSE]: https://github.com/socketry/nio4r/blob/master/ext/libev/LICENSE
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nio4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -17,8 +17,8 @@ dependencies:
|
|
17
17
|
- !ruby/object:Gem::Version
|
18
18
|
version: '0'
|
19
19
|
name: bundler
|
20
|
-
type: :development
|
21
20
|
prerelease: false
|
21
|
+
type: :development
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
@@ -31,8 +31,8 @@ dependencies:
|
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '0'
|
33
33
|
name: rake
|
34
|
-
type: :development
|
35
34
|
prerelease: false
|
35
|
+
type: :development
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
@@ -50,10 +50,9 @@ files:
|
|
50
50
|
- ".gitignore"
|
51
51
|
- ".rspec"
|
52
52
|
- ".rubocop.yml"
|
53
|
-
- CHANGES.md
|
54
53
|
- Gemfile
|
55
|
-
- README.md
|
56
54
|
- Rakefile
|
55
|
+
- changes.md
|
57
56
|
- examples/echo_server.rb
|
58
57
|
- ext/libev/Changes
|
59
58
|
- ext/libev/LICENSE
|
@@ -87,12 +86,15 @@ files:
|
|
87
86
|
- lib/nio/monitor.rb
|
88
87
|
- lib/nio/selector.rb
|
89
88
|
- lib/nio/version.rb
|
89
|
+
- lib/nio4r.rb
|
90
90
|
- lib/nio4r_ext.jar
|
91
|
+
- license.md
|
91
92
|
- logo.png
|
92
93
|
- nio4r.gemspec
|
93
94
|
- rakelib/extension.rake
|
94
95
|
- rakelib/rspec.rake
|
95
96
|
- rakelib/rubocop.rake
|
97
|
+
- readme.md
|
96
98
|
- spec/nio/acceptables_spec.rb
|
97
99
|
- spec/nio/bytebuffer_spec.rb
|
98
100
|
- spec/nio/monitor_spec.rb
|
@@ -109,8 +111,8 @@ licenses:
|
|
109
111
|
metadata:
|
110
112
|
bug_tracker_uri: https://github.com/socketry/nio4r/issues
|
111
113
|
changelog_uri: https://github.com/socketry/nio4r/blob/master/CHANGES.md
|
112
|
-
documentation_uri: https://www.rubydoc.info/gems/nio4r/2.
|
113
|
-
source_code_uri: https://github.com/socketry/nio4r/tree/v2.
|
114
|
+
documentation_uri: https://www.rubydoc.info/gems/nio4r/2.6.0
|
115
|
+
source_code_uri: https://github.com/socketry/nio4r/tree/v2.6.0
|
114
116
|
wiki_uri: https://github.com/socketry/nio4r/wiki
|
115
117
|
post_install_message:
|
116
118
|
rdoc_options: []
|
@@ -127,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
129
|
- !ruby/object:Gem::Version
|
128
130
|
version: '0'
|
129
131
|
requirements: []
|
130
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.3.25
|
131
133
|
signing_key:
|
132
134
|
specification_version: 4
|
133
135
|
summary: New IO for Ruby
|