File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,34 +25,21 @@ def initialize
2525 def <<( event )
2626 @queue << event
2727
28- begin
29- @output . write_nonblock ( "." )
30- rescue ::IO ::WaitWritable
31- # The pipe is already full, so any select waiter is already awake:
32- end
28+ # If the pipe is full, any select waiter is already awake:
29+ @output . write_nonblock ( "." , exception : false )
3330
3431 return self
3532 end
3633
3734 # Remove and return the next queued event.
38- # @parameter non_block [Boolean] Whether to raise if no event is ready.
39- # @parameter timeout [Numeric | Nil] The maximum time to wait for an event.
40- def pop ( non_block = false , timeout : nil )
41- if timeout
42- event = @queue . pop ( non_block , timeout : timeout )
43- else
44- event = @queue . pop ( non_block )
45- end
35+ def pop ( ...)
36+ event = @queue . pop ( ...)
4637
4738 return unless event
4839
49- @input . read_nonblock ( 1 )
40+ @input . read_nonblock ( 1 , exception : false )
5041
5142 return event
52- rescue ::IO ::WaitReadable
53- return event if event
54-
55- raise
5643 end
5744 end
5845 end
You can’t perform that action at this time.
0 commit comments