AsyncSourceAsyncChildren

class Children

A list of children tasks.

Definitions

def initialize

Create an empty list of children tasks.

Implementation

def initialize
	super
	@transient_count = 0
end

def transients?

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

Signature

returns Boolean

Whether the node has transient children.

Implementation

def transients?
	@transient_count > 0
end

def finished?

Whether all children are considered finished. Ignores transient children.

Implementation

def finished?
	@size == @transient_count
end

def nil?

Whether the children is empty, preserved for compatibility.

Implementation

def nil?
	empty?
end

def adjust_transient_count(transient)

Adjust the number of transient children, assuming it has changed.

Despite being public, this is not intended to be called directly. It is used internally by Async::Node#transient=.

Signature

parameter transient Boolean

Whether to increment or decrement the transient count.

Implementation

def adjust_transient_count(transient)
	if transient
		@transient_count += 1
	else
		@transient_count -= 1
	end
end

Discussion