You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Console.logger.debug(self){"Exiting run-loop because #{$! ? $! : 'finished'}."}
147
-
end
148
-
149
-
defstop(later=true)
150
-
@children&.eachdo |child|
151
-
# We don't want this process to propagate `Async::Stop` exceptions, so we schedule tasks to stop later.
152
-
child.stop(later)
153
-
end
154
-
end
155
-
156
-
# Stop each of the children tasks and close the selector.
157
-
#
158
-
# @return [void]
159
82
defclose
160
-
# This is a critical step. Because tasks could be stored as instance variables, and since the reactor is (probably) going out of scope, we need to ensure they are stopped. Otherwise, the tasks will belong to a reactor that will never run again and are not stopped.
161
-
self.stop(false)
162
-
163
-
@scheduler.close
164
-
@scheduler=nil
165
-
end
166
-
167
-
# Check if the selector has been closed.
168
-
# @return [Boolean]
169
-
defclosed?
170
-
@scheduler.nil?
171
-
end
172
-
173
-
# Put the calling fiber to sleep for a given ammount of time.
174
-
# @param duration [Numeric] The time in seconds, to sleep for.
175
-
defsleep(duration)
176
-
@scheduler.kernel_sleep(duration)
83
+
if@closing
84
+
super
85
+
else
86
+
@closing=true
87
+
self.clear!
88
+
end
177
89
end
178
90
179
-
# Invoke the block, but after the specified timeout, raise {TimeoutError} in any currenly blocking operation. If the block runs to completion before the timeout occurs or there are no non-blocking operations after the timeout expires, the code will complete without any exception.
180
-
# @param duration [Numeric] The time in seconds, in which the task should
0 commit comments