Skip to content

Commit c27cc12

Browse files
authored
Update README.md
1 parent 65fc0c1 commit c27cc12

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# AsyncChannelKit
22

3-
A simple implementation of an async channel for use with [AsyncSequence] and [AsyncIterator].
3+
A simple implementation of an async channel for use with [AsyncSequence] and [AsyncIterator] which matches
4+
the same interface as [Channel].
45

5-
When the `next()` function is called it is expected to return a value asynchronusly for an async for loop.
6+
When the `next()` function is called it is expected to return a value asynchronusly for an async `for` loop.
67
If the values are not created in response to calling this function these values will have to be provided
78
somehow. This channel supports sending values which the `next()` can return.
89

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.
10+
In the unit tests, a channel is created which is also a sequence. The `AyncIterator` is a nested type.
11+
When the iterator is created it is given the same channel. Calling `send` on the channel will make new
12+
values available. When the `next` function is called it creates a `continuation` which will be matched
13+
to a value so it can be returned. Calling `terminate` will use a `continuation` to send `nil` which tells
14+
the `for` loop it is done.
1315

14-
All of the work done by the channel is done as an actor type so that it is thread-safe.
16+
All of the work done by the channel is done as an actor type so that it is thread-safe. Since it only uses
17+
features from the Swift Standard Library it should be usable on every platform which has Swift support.
1518

1619
[AsyncSequence]: https://developer.apple.com/documentation/swift/asyncsequence
1720
[AsyncIterator]: https://developer.apple.com/documentation/swift/asyncsequence/asynciterator
21+
[Channel]: https://github.com/apple/swift-async-algorithms/blob/main/Sources/AsyncAlgorithms/AsyncAlgorithms.docc/Guides/Channel.md

0 commit comments

Comments
 (0)