Discussion 解説
When next()
returns nil
, this signifies the end of the Async
.
It is a programmer error to invoke next()
from a concurrent context that contends with another such call, which results in a call to fatal
.
If you cancel the task this iterator is running in while next()
is awaiting a value, the Async
terminates. In this case, next()
might return nil
immediately, or return nil
on subsequent calls.