File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -6,5 +6,12 @@ When the `next()` function is called it is expected to return a value asynchronu
6
6
If the values are not created in response to calling this function these values will have to be provided
7
7
somehow. This channel supports sending values which the ` next() ` can return.
8
8
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
+
9
16
[ AsyncSequence ] : https://developer.apple.com/documentation/swift/asyncsequence
10
17
[ AsyncIterator ] : https://developer.apple.com/documentation/swift/asyncsequence/asynciterator
You can’t perform that action at this time.
0 commit comments