Class: Async::Children
- Inherits:
-
List
- Object
- List
- Async::Children
- Defined in:
- lib/async/node.rb
Overview
A list of children tasks.
Instance Method Summary collapse
- #delete(item) ⇒ Object
- #finished? ⇒ Boolean
-
#initialize ⇒ Children
constructor
A new instance of Children.
- #insert(item) ⇒ Object
-
#transients? ⇒ Boolean
Does this node have (direct) transient children?.
Constructor Details
#initialize ⇒ Children
Returns a new instance of Children.
126 127 128 129 130 |
# File 'lib/async/node.rb', line 126 def initialize super @transient_count = 0 end |
Instance Method Details
#delete(item) ⇒ Object
145 146 147 148 149 150 151 |
# File 'lib/async/node.rb', line 145 def delete(item) if item.transient? @transient_count -= 1 end super end |
#finished? ⇒ Boolean
153 154 155 |
# File 'lib/async/node.rb', line 153 def finished? @size == @transient_count end |
#insert(item) ⇒ Object
137 138 139 140 141 142 143 |
# File 'lib/async/node.rb', line 137 def insert(item) if item.transient? @transient_count += 1 end super end |
#transients? ⇒ Boolean
Does this node have (direct) transient children?
133 134 135 |
# File 'lib/async/node.rb', line 133 def transients? @transient_count > 0 end |