event 0.5.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Binary file
data/ext/event/event.o DELETED
Binary file
data/ext/event/extconf.h DELETED
@@ -1,4 +0,0 @@
1
- #ifndef EXTCONF_H
2
- #define EXTCONF_H
3
- #define HAVE_SYS_EVENT_H 1
4
- #endif
data/ext/event/kqueue.o DELETED
Binary file
data/ext/event/mkmf.log DELETED
@@ -1,125 +0,0 @@
1
- have_func: checking for rb_fiber_transfer_kw()... -------------------- no
2
-
3
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
4
- checked program was:
5
- /* begin */
6
- 1: #include "ruby.h"
7
- 2:
8
- 3: int main(int argc, char **argv)
9
- 4: {
10
- 5: return !!argv[argc];
11
- 6: }
12
- /* end */
13
-
14
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
15
- conftest.c:14:57: error: use of undeclared identifier 'rb_fiber_transfer_kw'
16
- int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_fiber_transfer_kw; return !p; }
17
- ^
18
- 1 error generated.
19
- checked program was:
20
- /* begin */
21
- 1: #include "ruby.h"
22
- 2:
23
- 3: /*top*/
24
- 4: extern int t(void);
25
- 5: int main(int argc, char **argv)
26
- 6: {
27
- 7: if (argc > 1000000) {
28
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
29
- 9: printf("%d", (*tp)());
30
- 10: }
31
- 11:
32
- 12: return !!argv[argc];
33
- 13: }
34
- 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_fiber_transfer_kw; return !p; }
35
- /* end */
36
-
37
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
38
- Undefined symbols for architecture x86_64:
39
- "_rb_fiber_transfer_kw", referenced from:
40
- _t in conftest-3b7f21.o
41
- ld: symbol(s) not found for architecture x86_64
42
- clang: error: linker command failed with exit code 1 (use -v to see invocation)
43
- checked program was:
44
- /* begin */
45
- 1: #include "ruby.h"
46
- 2:
47
- 3: /*top*/
48
- 4: extern int t(void);
49
- 5: int main(int argc, char **argv)
50
- 6: {
51
- 7: if (argc > 1000000) {
52
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
53
- 9: printf("%d", (*tp)());
54
- 10: }
55
- 11:
56
- 12: return !!argv[argc];
57
- 13: }
58
- 14: extern void rb_fiber_transfer_kw();
59
- 15: int t(void) { rb_fiber_transfer_kw(); return 0; }
60
- /* end */
61
-
62
- --------------------
63
-
64
- have_library: checking for -luring... -------------------- no
65
-
66
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc -luring "
67
- ld: library not found for -luring
68
- clang: error: linker command failed with exit code 1 (use -v to see invocation)
69
- checked program was:
70
- /* begin */
71
- 1: #include "ruby.h"
72
- 2:
73
- 3: /*top*/
74
- 4: extern int t(void);
75
- 5: int main(int argc, char **argv)
76
- 6: {
77
- 7: if (argc > 1000000) {
78
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
79
- 9: printf("%d", (*tp)());
80
- 10: }
81
- 11:
82
- 12: return !!argv[argc];
83
- 13: }
84
- 14:
85
- 15: int t(void) { ; return 0; }
86
- /* end */
87
-
88
- --------------------
89
-
90
- have_header: checking for sys/epoll.h... -------------------- no
91
-
92
- "clang -E -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -o conftest.i"
93
- conftest.c:3:10: fatal error: 'sys/epoll.h' file not found
94
- #include <sys/epoll.h>
95
- ^~~~~~~~~~~~~
96
- 1 error generated.
97
- checked program was:
98
- /* begin */
99
- 1: #include "ruby.h"
100
- 2:
101
- 3: #include <sys/epoll.h>
102
- /* end */
103
-
104
- --------------------
105
-
106
- have_header: checking for sys/event.h... -------------------- yes
107
-
108
- "clang -E -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -o conftest.i"
109
- checked program was:
110
- /* begin */
111
- 1: #include "ruby.h"
112
- 2:
113
- 3: #include <sys/event.h>
114
- /* end */
115
-
116
- --------------------
117
-
118
- extconf.h is:
119
- /* begin */
120
- 1: #ifndef EXTCONF_H
121
- 2: #define EXTCONF_H
122
- 3: #define HAVE_SYS_EVENT_H 1
123
- 4: #endif
124
- /* end */
125
-
data/lib/event/backend.rb DELETED
@@ -1,49 +0,0 @@
1
- # Copyright, 2021, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require_relative 'backend/select'
22
-
23
- module Event
24
- module Backend
25
- def self.default(env = ENV)
26
- if backend = env['EVENT_BACKEND']&.to_sym
27
- if Event::Backend.const_defined?(backend)
28
- return Event::Backend.const_get(backend)
29
- else
30
- warn "Could not find EVENT_BACKEND=#{backend}!"
31
- end
32
- end
33
-
34
- if self.const_defined?(:URing)
35
- return Event::Backend::URing
36
- elsif self.const_defined?(:KQueue)
37
- return Event::Backend::KQueue
38
- elsif self.const_defined?(:EPoll)
39
- return Event::Backend::EPoll
40
- else
41
- return Event::Backend::Select
42
- end
43
- end
44
-
45
- def self.new(...)
46
- default.new(...)
47
- end
48
- end
49
- end
@@ -1,108 +0,0 @@
1
- # Copyright, 2021, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require "event/version"
22
-
23
- module Event
24
- module Debug
25
- class Selector
26
- def initialize(selector)
27
- @selector = selector
28
-
29
- @readable = {}
30
- @writable = {}
31
- @priority = {}
32
- end
33
-
34
- def close
35
- if @selector.nil?
36
- raise "Selector already closed!"
37
- end
38
-
39
- @selector.close
40
- @selector = nil
41
- end
42
-
43
- def io_wait(fiber, io, events)
44
- register_readable(fiber, io, events)
45
- end
46
-
47
- def select(duration = nil)
48
- @selector.select(duration)
49
- end
50
-
51
- private
52
-
53
- def register_readable(fiber, io, events)
54
- if (events & READABLE) > 0
55
- if @readable.key?(io)
56
- raise "Cannot wait for #{io} to become readable from multiple fibers."
57
- end
58
-
59
- begin
60
- @readable[io] = fiber
61
-
62
- register_writable(fiber, io, events)
63
- ensure
64
- @readable.delete(io)
65
- end
66
- else
67
- register_writable(fiber, io, events)
68
- end
69
- end
70
-
71
- def register_writable(fiber, io, events)
72
- if (events & WRITABLE) > 0
73
- if @writable.key?(io)
74
- raise "Cannot wait for #{io} to become writable from multiple fibers."
75
- end
76
-
77
- begin
78
- @writable[io] = fiber
79
-
80
- register_priority(fiber, io, events)
81
- ensure
82
- @writable.delete(io)
83
- end
84
- else
85
- register_priority(fiber, io, events)
86
- end
87
- end
88
-
89
- def register_priority(fiber, io, events)
90
- if (events & PRIORITY) > 0
91
- if @priority.key?(io)
92
- raise "Cannot wait for #{io} to become priority from multiple fibers."
93
- end
94
-
95
- begin
96
- @priority[io] = fiber
97
-
98
- @selector.io_wait(fiber, io, events)
99
- ensure
100
- @priority.delete(io)
101
- end
102
- else
103
- @selector.io_wait(fiber, io, events)
104
- end
105
- end
106
- end
107
- end
108
- end