async 1.15.3 → 1.15.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/debug/selector.rb +7 -1
- data/lib/async/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: a3754f6b9b83b39f95409fe1475169515918ea4989bf804516a499e2acc0ce8c
|
4
|
+
data.tar.gz: febf03b7a3c0da61b2719fc121864d8bef419bbeeec7a7e3885498f465b9254c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89d19e82a283cafd34436cc646b2671b54c1e22f0296ef8a338ae2235b3d4b40048bbe6f850086ff489ac73f2a62e61ac80e96238e9b6b8fa64d1dd10db98ee7
|
7
|
+
data.tar.gz: 19642a606b60ab0f18e69afb65dc84df82bcd38137153f45f3850f429379627a4ece569278e6c39a6ef12810bc995127d5c20e69ef575a697f49020d7920d9b6
|
data/lib/async/debug/selector.rb
CHANGED
@@ -25,6 +25,12 @@ require 'nio'
|
|
25
25
|
|
26
26
|
module Async
|
27
27
|
module Debug
|
28
|
+
class LeakError < RuntimeError
|
29
|
+
def initialize(monitors)
|
30
|
+
super "Trying to close selector with active monitors: #{monitors.inspect}! This may cause your socket or file descriptor to leak."
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
28
34
|
class Selector
|
29
35
|
def initialize(selector = NIO::Selector.new)
|
30
36
|
@selector = selector
|
@@ -67,7 +73,7 @@ module Async
|
|
67
73
|
|
68
74
|
def close
|
69
75
|
if @monitors.any?
|
70
|
-
raise
|
76
|
+
raise LeakError, @monitors.values
|
71
77
|
end
|
72
78
|
ensure
|
73
79
|
@selector.close
|
data/lib/async/version.rb
CHANGED