End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Rinda::TupleSpace#read
read(tuple, sec=nil) { |template| ... }
lib/rinda/tuplespace.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/rinda/tuplespace.rb, line 521
def read(tuple, sec=nil)
template = WaitTemplateEntry.new(self, tuple, sec)
yield(template) if block_given?
synchronize do
entry = @bag.find(template)
return entry.value if entry
raise RequestExpiredError if template.expired?
begin
@read_waiter.push(template)
start_keeper if template.expires
template.wait
raise RequestCanceledError if template.canceled?
raise RequestExpiredError if template.expired?
return template.found
ensure
@read_waiter.delete(template)
end
end
end
Reads tuple, but does not remove it.