Class: Async::Children
Overview
A list of children tasks.
Instance Attribute Summary
Attributes inherited from List
Instance Method Summary collapse
-
#finished? ⇒ Boolean
Whether all children are considered finished.
-
#initialize ⇒ Children
constructor
A new instance of Children.
-
#nil? ⇒ Boolean
Whether the children is empty, preserved for compatibility.
-
#transients? ⇒ Boolean
Some children may be marked as transient.
Methods inherited from List
#append, #each, #empty?, #first, #include?, #last, #prepend, #remove, #remove?, #shift, #stack, #to_a, #to_s
Constructor Details
#initialize ⇒ Children
Returns a new instance of Children.
13 14 15 16 |
# File 'lib/async/node.rb', line 13 def initialize super @transient_count = 0 end |
Instance Method Details
#finished? ⇒ Boolean
Whether all children are considered finished. Ignores transient children.
25 26 27 |
# File 'lib/async/node.rb', line 25 def finished? @size == @transient_count end |
#nil? ⇒ Boolean
Whether the children is empty, preserved for compatibility.
30 31 32 |
# File 'lib/async/node.rb', line 30 def nil? empty? end |
#transients? ⇒ Boolean
Some children may be marked as transient. Transient children do not prevent the parent from finishing.
20 21 22 |
# File 'lib/async/node.rb', line 20 def transients? @transient_count > 0 end |