io-dispatcher 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/io-dispatcher.rb +11 -0
- data/lib/io-dispatcher/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e0a54cde17f988b5f97c145492cd71ec36e5818ce5ae5269f489fdd08d96cae
|
4
|
+
data.tar.gz: a5cc0b6070eb5c694f9aac458aad9fbbea124c6004613a797ad5fe09bdeb49b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3c1570fbe6a5c28f7d8da8b9d85c4f136e579d2cebe2ae7520a26335a16bd298f4f1b728dc0a94925039e9001c84c11dcc94473777bf69a33cc889637a821c2
|
7
|
+
data.tar.gz: 83b33290d4ec698abb0ce198139d6644a89c433df0dc477804b38204298b6c0375091ccfe3e7edd758f8d1c71ccae7aeda8a6fbaa547cc4c7db1be6ec6c01eef
|
data/lib/io-dispatcher.rb
CHANGED
@@ -18,6 +18,17 @@ class IO
|
|
18
18
|
@io_handlers[mode][io] = handler || block
|
19
19
|
end
|
20
20
|
|
21
|
+
def remove_io_handler(input: nil, output: nil, exception: nil)
|
22
|
+
mode, io = if input
|
23
|
+
[0, input]
|
24
|
+
elsif output
|
25
|
+
[1, output]
|
26
|
+
elsif exception
|
27
|
+
[2, exception]
|
28
|
+
end
|
29
|
+
@io_handlers[mode].delete(io)
|
30
|
+
end
|
31
|
+
|
21
32
|
def set_timeout_handler(timeout, &block)
|
22
33
|
@timeout = timeout
|
23
34
|
@timeout_handler = block
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-dispatcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Labovitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -69,8 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
|
73
|
-
rubygems_version: 2.7.6
|
72
|
+
rubygems_version: 3.0.6
|
74
73
|
signing_key:
|
75
74
|
specification_version: 4
|
76
75
|
summary: Simple dispatcher for IO objects.
|