class Async::Node

def print_hierarchy(out = $stdout, backtrace: true)

@parameter backtrace [Boolean] Whether to print the backtrace of each node.
@parameter out [IO] The output stream to write to.

Print the hierarchy of the task tree from the given node.
def print_hierarchy(out = $stdout, backtrace: true)
	self.traverse do |node, level|
		indent = "\t" * level
		
		out.puts "#{indent}#{node}"
		
		print_backtrace(out, indent, node) if backtrace
	end
end