rage-iodine 1.7.58 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/iodine/fio.c +6 -7
- data/ext/iodine/scheduler.c +17 -12
- data/lib/iodine/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5b5db0d766696d96ae2730a5d954229249dbd982bceba8fb63f184a1da62beb
|
4
|
+
data.tar.gz: 397f34465e987d8f63c253f61ee7e3efd098aa94af63a55eeff81c5c13f5b088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00a9d42202213c7c34292b5d70074d17300736004a5d14df21bf9f1f9b933d3172335e07dbb5617f38c278a1f5073333114622dacd69870f258c65181f638cd4
|
7
|
+
data.tar.gz: bc5d84cf74cd4ee5078452fbd01ac67de8c0d2b7026d71af53136d47e862634fbf25d4910cb7e79280b77dab96bd91e76d92e1de41593e9ed2c11e0d0a2b27fe
|
data/ext/iodine/fio.c
CHANGED
@@ -4051,18 +4051,17 @@ static int fio_watch__internal(void *uuid_, void *protocol_) {
|
|
4051
4051
|
goto invalid_uuid;
|
4052
4052
|
}
|
4053
4053
|
|
4054
|
-
|
4055
|
-
// fio_protocol_s *old_pr = uuid_data(uuid).protocol;
|
4056
|
-
// fio_force_close_in_poll(uuid);
|
4057
|
-
// fio_unlock(&uuid_data(uuid).protocol_lock);
|
4058
|
-
// return 0;
|
4059
|
-
// }
|
4060
|
-
|
4054
|
+
fio_protocol_s *old_pr = uuid_data(uuid).protocol;
|
4061
4055
|
uuid_data(uuid).open = 1;
|
4062
4056
|
uuid_data(uuid).protocol = protocol;
|
4063
4057
|
touchfd(fio_uuid2fd(uuid));
|
4064
4058
|
fio_unlock(&uuid_data(uuid).protocol_lock);
|
4065
4059
|
|
4060
|
+
if (old_pr) {
|
4061
|
+
/* close old protocol */
|
4062
|
+
fio_defer_push_task(deferred_on_close, (void *)uuid, old_pr);
|
4063
|
+
}
|
4064
|
+
|
4066
4065
|
fio_poll_add(fio_uuid2fd(uuid));
|
4067
4066
|
return 0;
|
4068
4067
|
|
data/ext/iodine/scheduler.c
CHANGED
@@ -29,18 +29,23 @@ typedef struct {
|
|
29
29
|
VALUE block;
|
30
30
|
} scheduler_protocol_s;
|
31
31
|
|
32
|
-
static void iodine_scheduler_perform(intptr_t uuid, fio_protocol_s *fio_protocol) {
|
33
|
-
scheduler_protocol_s *protocol = (scheduler_protocol_s *)fio_protocol;
|
34
|
-
VALUE block = protocol->block;
|
35
32
|
|
36
|
-
|
33
|
+
static void iodine_scheduler_task_close(intptr_t uuid, fio_protocol_s *fio_protocol) {
|
34
|
+
scheduler_protocol_s *protocol = (scheduler_protocol_s *)fio_protocol;
|
37
35
|
|
38
|
-
IodineStore.remove(block);
|
36
|
+
IodineStore.remove(protocol->block);
|
39
37
|
fio_free(protocol);
|
40
38
|
|
41
39
|
(void)uuid;
|
42
40
|
}
|
43
41
|
|
42
|
+
static void iodine_scheduler_task_perform(intptr_t uuid, fio_protocol_s *fio_protocol) {
|
43
|
+
scheduler_protocol_s *protocol = (scheduler_protocol_s *)fio_protocol;
|
44
|
+
IodineCaller.call(protocol->block, call_id);
|
45
|
+
|
46
|
+
(void)uuid;
|
47
|
+
}
|
48
|
+
|
44
49
|
static VALUE iodine_scheduler_attach(VALUE self, VALUE r_fd, VALUE r_waittype, VALUE r_timeout) {
|
45
50
|
Check_Type(r_fd, T_FIXNUM);
|
46
51
|
int fd = FIX2INT(r_fd);
|
@@ -61,25 +66,25 @@ static VALUE iodine_scheduler_attach(VALUE self, VALUE r_fd, VALUE r_waittype, V
|
|
61
66
|
|
62
67
|
if ((waittype & ATTACH_ON_READ_READY_CALLBACK) && (waittype & ATTACH_ON_WRITE_READY_CALLBACK)) {
|
63
68
|
*protocol = (scheduler_protocol_s){
|
64
|
-
.p.on_data =
|
65
|
-
.p.on_ready =
|
66
|
-
.p.on_close =
|
69
|
+
.p.on_data = iodine_scheduler_task_perform,
|
70
|
+
.p.on_ready = iodine_scheduler_task_perform,
|
71
|
+
.p.on_close = iodine_scheduler_task_close,
|
67
72
|
.p.ping = noop,
|
68
73
|
.block = block,
|
69
74
|
};
|
70
75
|
} else if (waittype & ATTACH_ON_READ_READY_CALLBACK) {
|
71
76
|
*protocol = (scheduler_protocol_s){
|
72
|
-
.p.on_data =
|
77
|
+
.p.on_data = iodine_scheduler_task_perform,
|
73
78
|
.p.on_ready = noop,
|
74
|
-
.p.on_close =
|
79
|
+
.p.on_close = iodine_scheduler_task_close,
|
75
80
|
.p.ping = noop,
|
76
81
|
.block = block,
|
77
82
|
};
|
78
83
|
} else if (waittype & ATTACH_ON_WRITE_READY_CALLBACK) {
|
79
84
|
*protocol = (scheduler_protocol_s){
|
80
85
|
.p.on_data = noop,
|
81
|
-
.p.on_ready =
|
82
|
-
.p.on_close =
|
86
|
+
.p.on_ready = iodine_scheduler_task_perform,
|
87
|
+
.p.on_close = iodine_scheduler_task_close,
|
83
88
|
.p.ping = noop,
|
84
89
|
.block = block,
|
85
90
|
};
|
data/lib/iodine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rage-iodine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -253,7 +253,7 @@ licenses:
|
|
253
253
|
metadata:
|
254
254
|
allowed_push_host: https://rubygems.org
|
255
255
|
post_install_message: |-
|
256
|
-
Thank you for installing Iodine 1.
|
256
|
+
Thank you for installing Iodine 1.8.0.
|
257
257
|
Remember: if iodine supports your business, it's only fair to give value back (code contributions / donations).
|
258
258
|
rdoc_options: []
|
259
259
|
require_paths:
|