async fn fibonacci_waiter_example(
n: usize,
waiter: Option<(WaitGroup, WaitGuard)>,
) -> usizeExpand description
Demonstrates use of the WaitGroup and WaitGuard to (very inefficiently)
compute the Fibonacci number F(n) using recursive channels.
The given waiter will be used to detect when the work has finished and it will
close the channels. Additionally, waiter can be omitted to show that without
the WaitGroup, the tasks would not terminate.