- Inheritance
- < Object
- Included Modules
- DRbUndumped, MonitorMixin
The Tuplespace manages access to the tuples it contains, ensuring mutual exclusion requirements are met.
The sec option for the write, take, move, read and notify methods may either be a number of seconds or a Renewer object.
Methods
Class
Visibility | Signature |
---|---|
public | new (period=60) |
Instance
Visibility | Signature |
---|---|
public | move (port, tuple, sec=nil) {|template| ...} |
public | notify (event, tuple, sec=nil) |
public | read (tuple, sec=nil) {|template| ...} |
public | read_all (tuple) |
public | take (tuple, sec=nil, &block) |
public | write (tuple, sec=nil) |
Class Method Detail
new(period=60)
Creates a new TupleSpace. period is used to control how often to look for dead tuples after modifications to the TupleSpace.
If no dead tuples are found period seconds after the last modification, the TupleSpace will stop looking for dead tuples.
Instance Method Detail
move(port, tuple, sec=nil) {|template| ...}
Moves tuple to port.
notify(event, tuple, sec=nil)
Registers for notifications of event. Returns a NotifyTemplateEntry. See NotifyTemplateEntry for examples of how to listen for notifications.
event can be:
‘write’: | A tuple was added |
‘take’: | A tuple was taken or moved |
‘delete’: | A tuple was lost after being overwritten or expiring |
The TupleSpace will also notify you of the ‘close’ event when the NotifyTemplateEntry has expired.
read(tuple, sec=nil) {|template| ...}
Reads tuple, but does not remove it.
read_all(tuple)
Returns all tuples matching tuple. Does not remove the found tuples.
take(tuple, sec=nil, &block)
Removes tuple
write(tuple, sec=nil)
Adds tuple