2
2
3
3
* Proposal: [ SAA-0016] ( 0016-multi-producer-single-consumer-channel.md )
4
4
* Authors: [ Franz Busch] ( https://github.com/FranzBusch )
5
- * Review Manager: TBD
6
5
* Status: ** Implemented**
7
6
8
7
## Revision
9
- - 2025/03/24: Adopt ` ~Copyable ` for better performance.
8
+ - 2025/03/24: Adopt ` ~Copyable ` for correct semantics and better performance.
10
9
- 2023/12/18: Migrate proposal from Swift Evolution to Swift Async Algorithms.
11
10
- 2023/12/19: Add element size dependent strategy
12
11
- 2024/05/19: Rename to multi producer single consumer channel
@@ -25,8 +24,8 @@ with the goal to model asynchronous multi-producer-single-consumer systems.
25
24
After using the ` AsyncSequence ` protocol, the ` Async[Throwing]Stream ` types, and
26
25
the ` Async[Throwing]Channel ` types extensively over the past years, we learned
27
26
that there is a gap in the ecosystem for a type that provides strict
28
- multi-producer-single-consumer guarantees with backpressure support.
29
- Additionally, any type stream/channel like type needs to have a clear definition
27
+ multi-producer-single-consumer guarantees with external backpressure support.
28
+ Additionally, any stream/channel like type needs to have a clear definition
30
29
about the following behaviors:
31
30
32
31
1 . Backpressure
@@ -138,9 +137,9 @@ protocols are not supporting `~Copyable` types we provide a way to convert the
138
137
proposed channel to an asynchronous sequence. This leaves us room to support any
139
138
potential future asynchronous streaming protocol that supports ` ~Copyable ` .
140
139
141
- ### Creating an MultiProducerSingleConsumerChannel
140
+ ### Creating a MultiProducerSingleConsumerChannel
142
141
143
- You can create an ` MultiProducerSingleConsumerChannel ` instance using the new
142
+ You can create an ` MultiProducerSingleConsumerChannel ` instance using the
144
143
` makeChannel(of: backpressureStrategy:) ` method. This method returns you the
145
144
channel and the source. The source can be used to send new values to the
146
145
asynchronous channel. The new API specifically provides a
@@ -839,7 +838,7 @@ To achieve maximum performance the implementation is using `~Copyable` extensive
839
838
On Swift versions before 6.1, there is a https://github.com/swiftlang/swift/issues/78048 when using; hence, this type
840
839
is only usable with Swift 6.1 and later compilers.
841
840
842
- ## Acknowledgements
841
+ ## Acknowledgements
843
842
844
843
- [ Johannes Weiss] ( https://github.com/weissi ) - For making me aware how
845
844
important this problem is and providing great ideas on how to shape the API.
0 commit comments