Skip to content

Commit f64b0a8

Browse files
author
Brennan Stehling
committed
updates README.md
1 parent 7a5a3da commit f64b0a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@ When the `next()` function is called it is expected to return a value asynchronu
66
If the values are not created in response to calling this function these values will have to be provided
77
somehow. This channel supports sending values which the `next()` can return.
88

9+
In the unit tests, a channel is created and given to the sequence. When the iterator is created it is
10+
given the same channel. Calling `send` on the channel will make new values available. When the `next`
11+
function is called it creates a `continuation` which will be matched to a value so it can be returned.
12+
Calling `terminate` will use a `continuation` to send `nil` which tells the for loop it is done.
13+
14+
All of the work done by the channel is done as an actor type so that it is thread-safe.
15+
916
[AsyncSequence]: https://developer.apple.com/documentation/swift/asyncsequence
1017
[AsyncIterator]: https://developer.apple.com/documentation/swift/asyncsequence/asynciterator

0 commit comments

Comments
 (0)