event 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/event/selector/epoll.c +11 -0
- data/ext/event/selector/kqueue.c +11 -0
- data/ext/event/selector/uring.c +11 -0
- data/lib/event/selector/select.rb +5 -0
- data/lib/event/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df986c171ee38a8b081284b28cb7972f3b7ba96b60d47d370ccac6808fe01ff9
|
4
|
+
data.tar.gz: fd87f66165976f4704e9244f044aedda6a949c87f2879ede07cfc728a24f778e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e522241d001f0d42b364ab51ff0e555c4cbde87daf91f3bedcd93bb8c14ee8a351b413b6156d7f9e94606c3a7536de39fcc71ef2525d85c420c6def51a092cc5
|
7
|
+
data.tar.gz: 297fe75b5789cb10dc32807a2a78bf36514773c1d41646cf1163c6fd7be7ecbedd1239bed631ff825836934dab9fc08eccfb27a2d15d39abb08159b05d01b95c
|
data/ext/event/selector/epoll.c
CHANGED
@@ -112,6 +112,16 @@ VALUE Event_Selector_EPoll_close(VALUE self) {
|
|
112
112
|
return Qnil;
|
113
113
|
}
|
114
114
|
|
115
|
+
VALUE Event_Selector_EPoll_transfer(VALUE self)
|
116
|
+
{
|
117
|
+
struct Event_Selector_EPoll *data = NULL;
|
118
|
+
TypedData_Get_Struct(self, struct Event_Selector_EPoll, &Event_Selector_EPoll_Type, data);
|
119
|
+
|
120
|
+
Event_Selector_fiber_transfer(data->backend.loop, 0, NULL);
|
121
|
+
|
122
|
+
return Qnil;
|
123
|
+
}
|
124
|
+
|
115
125
|
VALUE Event_Selector_EPoll_resume(int argc, VALUE *argv, VALUE self)
|
116
126
|
{
|
117
127
|
struct Event_Selector_EPoll *data = NULL;
|
@@ -550,6 +560,7 @@ void Init_Event_Selector_EPoll(VALUE Event_Selector) {
|
|
550
560
|
rb_define_alloc_func(Event_Selector_EPoll, Event_Selector_EPoll_allocate);
|
551
561
|
rb_define_method(Event_Selector_EPoll, "initialize", Event_Selector_EPoll_initialize, 1);
|
552
562
|
|
563
|
+
rb_define_method(Event_Selector_EPoll, "transfer", Event_Selector_EPoll_transfer, 0);
|
553
564
|
rb_define_method(Event_Selector_EPoll, "resume", Event_Selector_EPoll_resume, -1);
|
554
565
|
rb_define_method(Event_Selector_EPoll, "yield", Event_Selector_EPoll_yield, 0);
|
555
566
|
rb_define_method(Event_Selector_EPoll, "push", Event_Selector_EPoll_push, 1);
|
data/ext/event/selector/kqueue.c
CHANGED
@@ -112,6 +112,16 @@ VALUE Event_Selector_KQueue_close(VALUE self) {
|
|
112
112
|
return Qnil;
|
113
113
|
}
|
114
114
|
|
115
|
+
VALUE Event_Selector_KQueue_transfer(VALUE self)
|
116
|
+
{
|
117
|
+
struct Event_Selector_KQueue *data = NULL;
|
118
|
+
TypedData_Get_Struct(self, struct Event_Selector_KQueue, &Event_Selector_KQueue_Type, data);
|
119
|
+
|
120
|
+
Event_Selector_fiber_transfer(data->backend.loop, 0, NULL);
|
121
|
+
|
122
|
+
return Qnil;
|
123
|
+
}
|
124
|
+
|
115
125
|
VALUE Event_Selector_KQueue_resume(int argc, VALUE *argv, VALUE self)
|
116
126
|
{
|
117
127
|
struct Event_Selector_KQueue *data = NULL;
|
@@ -616,6 +626,7 @@ void Init_Event_Selector_KQueue(VALUE Event_Selector) {
|
|
616
626
|
rb_define_alloc_func(Event_Selector_KQueue, Event_Selector_KQueue_allocate);
|
617
627
|
rb_define_method(Event_Selector_KQueue, "initialize", Event_Selector_KQueue_initialize, 1);
|
618
628
|
|
629
|
+
rb_define_method(Event_Selector_KQueue, "transfer", Event_Selector_KQueue_transfer, 0);
|
619
630
|
rb_define_method(Event_Selector_KQueue, "resume", Event_Selector_KQueue_resume, -1);
|
620
631
|
rb_define_method(Event_Selector_KQueue, "yield", Event_Selector_KQueue_yield, 0);
|
621
632
|
rb_define_method(Event_Selector_KQueue, "push", Event_Selector_KQueue_push, 1);
|
data/ext/event/selector/uring.c
CHANGED
@@ -115,6 +115,16 @@ VALUE Event_Selector_URing_close(VALUE self) {
|
|
115
115
|
return Qnil;
|
116
116
|
}
|
117
117
|
|
118
|
+
VALUE Event_Selector_URing_transfer(VALUE self)
|
119
|
+
{
|
120
|
+
struct Event_Selector_URing *data = NULL;
|
121
|
+
TypedData_Get_Struct(self, struct Event_Selector_URing, &Event_Selector_URing_Type, data);
|
122
|
+
|
123
|
+
Event_Selector_fiber_transfer(data->backend.loop, 0, NULL);
|
124
|
+
|
125
|
+
return Qnil;
|
126
|
+
}
|
127
|
+
|
118
128
|
VALUE Event_Selector_URing_resume(int argc, VALUE *argv, VALUE self)
|
119
129
|
{
|
120
130
|
struct Event_Selector_URing *data = NULL;
|
@@ -615,6 +625,7 @@ void Init_Event_Selector_URing(VALUE Event_Selector) {
|
|
615
625
|
rb_define_alloc_func(Event_Selector_URing, Event_Selector_URing_allocate);
|
616
626
|
rb_define_method(Event_Selector_URing, "initialize", Event_Selector_URing_initialize, 1);
|
617
627
|
|
628
|
+
rb_define_method(Event_Selector_URing, "transfer", Event_Selector_URing_transfer, 0);
|
618
629
|
rb_define_method(Event_Selector_URing, "resume", Event_Selector_URing_resume, -1);
|
619
630
|
rb_define_method(Event_Selector_URing, "yield", Event_Selector_URing_yield, 0);
|
620
631
|
rb_define_method(Event_Selector_URing, "push", Event_Selector_URing_push, 1);
|
@@ -50,6 +50,11 @@ module Event
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
# Transfer from the current fiber to the event loop.
|
54
|
+
def transfer
|
55
|
+
@loop.transfer
|
56
|
+
end
|
57
|
+
|
53
58
|
# Transfer from the current fiber to the specified fiber. Put the current fiber into the ready list.
|
54
59
|
def resume(fiber, *arguments)
|
55
60
|
queue = Queue.new(Fiber.current)
|
data/lib/event/version.rb
CHANGED