Class: Rinda::WaitTemplateEntry Private

Inherits:
Object
  • Object
show all
Defined in:
lib/pione/patch/rinda-patch.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(place, ary, expires = nil) ⇒ WaitTemplateEntry

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Note:

removed monitor from original

Returns a new instance of WaitTemplateEntry.



52
53
54
55
56
57
58
# File 'lib/pione/patch/rinda-patch.rb', line 52

def initialize(place, ary, expires=nil)
  super(ary, expires)
  @place = place
  @found = nil
  @signaled = false
  @finished = false
end

Instance Attribute Details

#finishedObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



48
49
50
# File 'lib/pione/patch/rinda-patch.rb', line 48

def finished
  @finished
end

#foundObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



46
47
48
# File 'lib/pione/patch/rinda-patch.rb', line 46

def found
  @found
end

#placeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



44
45
46
# File 'lib/pione/patch/rinda-patch.rb', line 44

def place
  @place
end

#signaledObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



47
48
49
# File 'lib/pione/patch/rinda-patch.rb', line 47

def signaled
  @signaled
end

#threadObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



45
46
47
# File 'lib/pione/patch/rinda-patch.rb', line 45

def thread
  @thread
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



92
93
94
95
96
97
98
99
# File 'lib/pione/patch/rinda-patch.rb', line 92

def ==(other)
  return false unless other.kind_of?(WaitTemplateEntry)
  return false unless value == other.value
  return false unless @thread == other.thread
  return false unless @signaled == other.signaled
  return false unless @finished == other.finished
  return true
end

#inspectObject Also known as: to_s

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/pione/patch/rinda-patch.rb', line 77

def inspect
  infos = [
    "@cancel=%s" % @cancel,
    "@expires=%s" % @expires,
    "@tuple=%s" % @tuple.inspect,
    "@renewer=%s" % @renewer.inspect,
    "@found=%s" % @found.inspect,
    "@thread=%s" % @thread.inspect,
    "@signaled=%s" % @signaled,
    "@finished=%s" % @finished
  ]
  "#<%s:%s %s>" % ["Rinda::WaitTemplateEntry", __id__, infos.join(", ")]
end

#signalObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Note:

thread version(don't use monitor)



70
71
72
73
74
75
# File 'lib/pione/patch/rinda-patch.rb', line 70

def signal
  @signaled = true
  if @thread && @thread.status == "sleep"
    @thread.run
  end
end

#waitObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Note:

thread version(don't use monitor)



62
63
64
65
66
# File 'lib/pione/patch/rinda-patch.rb', line 62

def wait
  @thread = Thread.current
  Thread.stop
  @thread = nil
end