io-event 1.1.4 → 1.1.6
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
- checksums.yaml.gz.sig +0 -0
- data/ext/io/event/selector/uring.c +5 -3
- data/lib/io/event/interrupt.rb +2 -0
- data/lib/io/event/selector/nonblock.rb +3 -0
- data/lib/io/event/selector/select.rb +6 -0
- data/lib/io/event/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2b1d6d29aedc2b375fa708f5f3518fb39dae6ee0b5c675a4ff571192f3c00ef
|
4
|
+
data.tar.gz: 6e9b9589ef99c97a287d20e4f60f501d87ca163897d21bdd59eb03aa71085ffd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6447991710738ba24577100220b4ca322d79179d736ba3101bdd5fd2a2d8a23aa8983d527ebc13cdde5b038601c17d6a860ed21394a2f3d584ddd68772f505b6
|
7
|
+
data.tar.gz: e8a0232a3f36be1bfab1a1ca8a9e0a68e761d89d9f1576449ea23644eddc2643f89c9963186376d1211f25fb96853cadef82c673ca81af7430cdacb45d3f37ea
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -179,6 +179,7 @@ VALUE IO_Event_Selector_URing_ready_p(VALUE self) {
|
|
179
179
|
return data->backend.ready ? Qtrue : Qfalse;
|
180
180
|
}
|
181
181
|
|
182
|
+
// Flush the submission queue if pending operations are present.
|
182
183
|
static
|
183
184
|
int io_uring_submit_flush(struct IO_Event_Selector_URing *data) {
|
184
185
|
if (data->pending) {
|
@@ -200,6 +201,7 @@ int io_uring_submit_flush(struct IO_Event_Selector_URing *data) {
|
|
200
201
|
return 0;
|
201
202
|
}
|
202
203
|
|
204
|
+
// Immediately flush the submission queue, yielding to the event loop if it was not successful.
|
203
205
|
static
|
204
206
|
int io_uring_submit_now(struct IO_Event_Selector_URing *data) {
|
205
207
|
while (true) {
|
@@ -656,6 +658,9 @@ VALUE IO_Event_Selector_URing_select(VALUE self, VALUE duration) {
|
|
656
658
|
struct IO_Event_Selector_URing *data = NULL;
|
657
659
|
TypedData_Get_Struct(self, struct IO_Event_Selector_URing, &IO_Event_Selector_URing_Type, data);
|
658
660
|
|
661
|
+
// Flush any pending events:
|
662
|
+
io_uring_submit_flush(data);
|
663
|
+
|
659
664
|
int ready = IO_Event_Selector_queue_flush(&data->backend);
|
660
665
|
|
661
666
|
int result = select_process_completions(&data->ring);
|
@@ -677,9 +682,6 @@ VALUE IO_Event_Selector_URing_select(VALUE self, VALUE duration) {
|
|
677
682
|
if (!data->backend.ready && !timeout_nonblocking(arguments.timeout)) {
|
678
683
|
// This is a blocking operation, we wait for events:
|
679
684
|
result = select_internal_without_gvl(&arguments);
|
680
|
-
} else {
|
681
|
-
// The timeout specified required "nonblocking" behaviour so we just flush the SQ if required:
|
682
|
-
io_uring_submit_flush(data);
|
683
685
|
}
|
684
686
|
|
685
687
|
// After waiting/flushing the SQ, check if there are any completions:
|
data/lib/io/event/interrupt.rb
CHANGED
@@ -134,6 +134,12 @@ module IO::Event
|
|
134
134
|
waiter&.invalidate
|
135
135
|
end
|
136
136
|
|
137
|
+
def io_select(readable, writable, priority, timeout)
|
138
|
+
Thread.new do
|
139
|
+
IO.select(readable, writable, priority, timeout)
|
140
|
+
end.value
|
141
|
+
end
|
142
|
+
|
137
143
|
EAGAIN = -Errno::EAGAIN::Errno
|
138
144
|
EWOULDBLOCK = -Errno::EWOULDBLOCK::Errno
|
139
145
|
|
data/lib/io/event/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-event
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -41,7 +41,7 @@ cert_chain:
|
|
41
41
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
42
42
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
43
43
|
-----END CERTIFICATE-----
|
44
|
-
date:
|
44
|
+
date: 2023-01-10 00:00:00.000000000 Z
|
45
45
|
dependencies:
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: bake
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
153
|
+
rubygems_version: 3.4.1
|
154
154
|
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: An event loop.
|
metadata.gz.sig
CHANGED
Binary file
|