Skip to content

Commit

Permalink
Handle IOError from closed selector
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanp committed Jun 28, 2023
1 parent 7425e40 commit 5510a4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/goru/reactor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ def finished?
# [public]
#
def wakeup
@selector.wakeup rescue IOError
@selector.wakeup
rescue IOError
# nothing to do
end

# [public]
Expand Down
6 changes: 4 additions & 2 deletions lib/goru/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def wait
@waiting = true
@reactors.each(&:wakeup)
@selector.select while @waiting
rescue Interrupt
rescue IOError, Interrupt
# nothing to do
ensure
stop
Expand All @@ -110,7 +110,9 @@ def signal
end

def wakeup
@selector.wakeup rescue IOError
@selector.wakeup
rescue IOError
# nothing to do
end
end
end

0 comments on commit 5510a4b

Please sign in to comment.