Skip to content

Commit 4c32055

Browse files
committed
worker,supervisor: refactor shutdown signaling mechanics
IO#ready? does not exist in ruby4.
1 parent 4db2abe commit 4c32055

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/rspecq/worker.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ def initialize(build_id:, worker_id:, redis_opts:, shutdown_pipe: nil)
8787
end
8888

8989
def shutdown?
90-
@shutdown_pipe&.ready?
90+
return false if @shutdown_pipe.nil?
91+
92+
# returns :wait_readable if the supervisor has not signaled shutdown (closed the writer)
93+
@shutdown_pipe.read_nonblock(1, exception: false).nil?
9194
end
9295

9396
def work

0 commit comments

Comments
 (0)