io-event 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/ext/extconf.rb +1 -1
- data/lib/io/event/interrupt.rb +1 -1
- data/lib/io/event/selector/nonblock.rb +1 -1
- data/lib/io/event/selector/select.rb +25 -8
- data/lib/io/event/version.rb +2 -2
- data/lib/io/event.rb +1 -1
- data/license.md +2 -1
- data/readme.md +13 -5
- data.tar.gz.sig +0 -0
- metadata +6 -61
- 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: 41757dbe8c584fbdf66a0d7adb6b4e7f3ab377aed137c65b49eed48e7ff1d223
|
4
|
+
data.tar.gz: 84672d42c12a9db38d901a7f4ab4d8f3d74bc98d398fb615d95c6780533bb2bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d32bce07ae295fecd57c67920ec2c0f3796313d80154179290116eb8ad8fd3b58e440c5531a23186bb9cfe2dfdd87fccd709742742559d8d151ae9b0cdb1419
|
7
|
+
data.tar.gz: e6a6476decc497fab325b047ec7c90c235e505356cf07e145c5ed9e00443b9273743a8180c6e12e5a2d496b8e8d4b42a781438e175d3768f3d6f86ce3b84c9fc
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/ext/extconf.rb
CHANGED
data/lib/io/event/interrupt.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2023, by Samuel Williams.
|
5
|
+
# Copyright, 2023, by Math Ieu.
|
5
6
|
|
6
7
|
require_relative '../interrupt'
|
7
8
|
require_relative '../support'
|
@@ -103,14 +104,26 @@ module IO::Event
|
|
103
104
|
self.fiber&.alive?
|
104
105
|
end
|
105
106
|
|
106
|
-
|
107
|
+
# Dispatch the given events to the list of waiting fibers. If the fiber was not waiting for the given events, it is reactivated by calling the given block.
|
108
|
+
def dispatch(events, &reactivate)
|
109
|
+
# We capture the tail here, because calling reactivate might modify it:
|
110
|
+
tail = self.tail
|
111
|
+
|
107
112
|
if fiber = self.fiber
|
108
|
-
|
109
|
-
|
110
|
-
|
113
|
+
if fiber.alive?
|
114
|
+
revents = events & self.events
|
115
|
+
if revents.zero?
|
116
|
+
reactivate.call(self)
|
117
|
+
else
|
118
|
+
self.fiber = nil
|
119
|
+
fiber.transfer(revents)
|
120
|
+
end
|
121
|
+
else
|
122
|
+
self.fiber = nil
|
123
|
+
end
|
111
124
|
end
|
112
|
-
|
113
|
-
|
125
|
+
|
126
|
+
tail&.dispatch(events, &reactivate)
|
114
127
|
end
|
115
128
|
|
116
129
|
def invalidate
|
@@ -349,7 +362,11 @@ module IO::Event
|
|
349
362
|
end
|
350
363
|
|
351
364
|
ready.each do |io, events|
|
352
|
-
@waiting.delete(io).
|
365
|
+
@waiting.delete(io).dispatch(events) do |waiter|
|
366
|
+
# Re-schedule the waiting IO:
|
367
|
+
waiter.tail = @waiting[io]
|
368
|
+
@waiting[io] = waiter
|
369
|
+
end
|
353
370
|
end
|
354
371
|
|
355
372
|
return ready.size
|
data/lib/io/event/version.rb
CHANGED
data/lib/io/event.rb
CHANGED
data/license.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# MIT License
|
2
2
|
|
3
|
-
Copyright, 2021-
|
3
|
+
Copyright, 2021-2023, by Samuel Williams.
|
4
4
|
Copyright, 2021, by Delton Ding.
|
5
5
|
Copyright, 2021, by Benoit Daloze.
|
6
6
|
Copyright, 2022, by Alex Matchneer.
|
7
7
|
Copyright, 2022, by Bruno Sutic.
|
8
|
+
Copyright, 2023, by Math Ieu.
|
8
9
|
|
9
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
11
|
of this software and associated documentation files (the "Software"), to deal
|
data/readme.md
CHANGED
@@ -16,8 +16,16 @@ Please see the [project documentation](https://socketry.github.io/io-event/).
|
|
16
16
|
|
17
17
|
We welcome contributions to this project.
|
18
18
|
|
19
|
-
1. Fork it
|
20
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
21
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
22
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
23
|
-
5. Create new Pull Request
|
19
|
+
1. Fork it.
|
20
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
21
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
22
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
23
|
+
5. Create new Pull Request.
|
24
|
+
|
25
|
+
### Developer Certificate of Origin
|
26
|
+
|
27
|
+
This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
|
28
|
+
|
29
|
+
### Contributor Covenant
|
30
|
+
|
31
|
+
This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-event
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
- Bruno Sutic
|
9
|
+
- Math Ieu
|
10
|
+
- Alex Matchneer
|
9
11
|
- Benoit Daloze
|
10
12
|
- Delton Ding
|
11
|
-
- machty
|
12
13
|
autorequire:
|
13
14
|
bindir: bin
|
14
15
|
cert_chain:
|
@@ -41,64 +42,8 @@ cert_chain:
|
|
41
42
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
42
43
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
43
44
|
-----END CERTIFICATE-----
|
44
|
-
date: 2023-
|
45
|
-
dependencies:
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: bake
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
requirements:
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: '0'
|
53
|
-
type: :development
|
54
|
-
prerelease: false
|
55
|
-
version_requirements: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '0'
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: bundler
|
62
|
-
requirement: !ruby/object:Gem::Requirement
|
63
|
-
requirements:
|
64
|
-
- - ">="
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: '0'
|
67
|
-
type: :development
|
68
|
-
prerelease: false
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - ">="
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: '0'
|
74
|
-
- !ruby/object:Gem::Dependency
|
75
|
-
name: covered
|
76
|
-
requirement: !ruby/object:Gem::Requirement
|
77
|
-
requirements:
|
78
|
-
- - ">="
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '0'
|
81
|
-
type: :development
|
82
|
-
prerelease: false
|
83
|
-
version_requirements: !ruby/object:Gem::Requirement
|
84
|
-
requirements:
|
85
|
-
- - ">="
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: '0'
|
88
|
-
- !ruby/object:Gem::Dependency
|
89
|
-
name: sus
|
90
|
-
requirement: !ruby/object:Gem::Requirement
|
91
|
-
requirements:
|
92
|
-
- - "~>"
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: '0.6'
|
95
|
-
type: :development
|
96
|
-
prerelease: false
|
97
|
-
version_requirements: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
99
|
-
- - "~>"
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0.6'
|
45
|
+
date: 2023-07-26 00:00:00.000000000 Z
|
46
|
+
dependencies: []
|
102
47
|
description:
|
103
48
|
email:
|
104
49
|
executables: []
|
@@ -150,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
95
|
- !ruby/object:Gem::Version
|
151
96
|
version: '0'
|
152
97
|
requirements: []
|
153
|
-
rubygems_version: 3.4.
|
98
|
+
rubygems_version: 3.4.10
|
154
99
|
signing_key:
|
155
100
|
specification_version: 4
|
156
101
|
summary: An event loop.
|
metadata.gz.sig
CHANGED
Binary file
|