method
write
v1_8_7_330 -
Show latest stable
- Class:
Rinda::TupleSpace
write(tuple, sec=nil)public
Adds tuple
# File lib/rinda/tuplespace.rb, line 451
def write(tuple, sec=nil)
entry = create_entry(tuple, sec)
synchronize do
if entry.expired?
@read_waiter.find_all_template(entry).each do |template|
template.read(tuple)
end
notify_event('write', entry.value)
notify_event('delete', entry.value)
else
@bag.push(entry)
start_keeper if entry.expires
@read_waiter.find_all_template(entry).each do |template|
template.read(tuple)
end
@take_waiter.find_all_template(entry).each do |template|
template.signal
end
notify_event('write', entry.value)
end
end
entry
end Related methods
- Instance methods
- move
- notify
- read
- read_all
- take
- write
- Class methods
- new
- Private methods
-
create_entry -
keep_clean -
need_keeper? -
notify_event -
start_keeper