Class: Rinda::WaitTemplateEntry

Inherits:
TemplateEntry show all
Defined in:
lib/rinda/tuplespace.rb

Overview

Documentation?

Instance Attribute Summary (collapse)

Attributes inherited from TupleEntry

#expires

Instance Method Summary (collapse)

Methods inherited from TemplateEntry

#make_tuple, #match

Methods inherited from TupleEntry

#[], #alive?, #canceled?, #expired?, #fetch, #make_expires, #make_tuple, #renew, #size, #value

Methods included from DRb::DRbUndumped

#_dump

Constructor Details

- (WaitTemplateEntry) initialize(place, ary, expires = nil)

A new instance of WaitTemplateEntry



187
188
189
190
191
192
# File 'lib/rinda/tuplespace.rb', line 187

def initialize(place, ary, expires=nil)
  super(ary, expires)
  @place = place
  @cond = place.new_cond
  @found = nil
end

Instance Attribute Details

- (Object) found (readonly)

Returns the value of attribute found



185
186
187
# File 'lib/rinda/tuplespace.rb', line 185

def found
  @found
end

Instance Method Details

- (Object) cancel



194
195
196
197
# File 'lib/rinda/tuplespace.rb', line 194

def cancel
  super
  signal
end

- (Object) read(tuple)



203
204
205
206
# File 'lib/rinda/tuplespace.rb', line 203

def read(tuple)
  @found = tuple
  signal
end

- (Object) signal



208
209
210
211
212
# File 'lib/rinda/tuplespace.rb', line 208

def signal
  @place.synchronize do
    @cond.signal
  end
end

- (Object) wait



199
200
201
# File 'lib/rinda/tuplespace.rb', line 199

def wait
  @cond.wait
end