Object
# File lib/concurrent/channel/selector/after_clause.rb, line 10 def initialize(seconds, block) raise ArgumentError.new('timeout must 0.0 or more') if seconds.to_f < 0.0 @end = Concurrent.monotonic_time + seconds.to_f @block = block end
# File lib/concurrent/channel/selector/after_clause.rb, line 16 def execute if Concurrent.monotonic_time > @end result = @block ? @block.call : nil Concurrent::Maybe.just(result) else Concurrent::Maybe.nothing end end
[Validate]
Generated with the Darkfish Rdoc Generator 2.