Class: Async::Children

Inherits:
List
  • Object
show all
Defined in:
lib/async/node.rb

Overview

A list of children tasks.

Instance Attribute Summary

Attributes inherited from List

#head, #size, #tail

Instance Method Summary collapse

Methods inherited from List

#append, #each, #empty?, #first, #include?, #last, #prepend, #remove, #remove?, #shift, #stack, #to_a, #to_s

Constructor Details

#initializeChildren

Returns a new instance of Children.



15
16
17
18
# File 'lib/async/node.rb', line 15

def initialize
	super
	@transient_count = 0
end

Instance Method Details

#finished?Boolean

Whether all children are considered finished. Ignores transient children.

Returns:

  • (Boolean)


27
28
29
# File 'lib/async/node.rb', line 27

def finished?
	@size == @transient_count
end

#nil?Boolean

Whether the children is empty, preserved for compatibility.

Returns:

  • (Boolean)


32
33
34
# File 'lib/async/node.rb', line 32

def nil?
	empty?
end

#transients?Boolean

Some children may be marked as transient. Transient children do not prevent the parent from finishing.

Returns:

  • (Boolean)


22
23
24
# File 'lib/async/node.rb', line 22

def transients?
	@transient_count > 0
end