Commit 4886bd5
[Concurrency] AsyncStream and AsyncThrowingStream
* Rework YieldingContinuation to service values in a buffered fashion
* Fix word size calculation for locks
* Handle terminal states and finished/failed storage
* Wrap yielding continuation into a more featureful type for better ergonomics
* Hope springs eternal, maybe windows works with this?
* Prevent value overflows at .max limits
* Add a cancellation handler
* Fix series tests missing continuation parameters
* Fix series tests for mutable itertaors
* Rename to a more general name for Series's inner continuation type
* Whitespace fixes and add more commentary about public functions on Series
* Restore YieldingContinuation for now with deprecations to favor Series
* Ensure onCancel is invoked in deinit phases, and eliminate a potential for double cancellation
* Make sure ThrowingSeries has the same nonmutating setter for onCancel as Series
* Add a swath of more unit tests that exersize cancellation behavior as well as throwing behaviors
* Remove work-around for async testing
* Fixup do/catch range to properly handle ThrowingSeries test
* Address naming consistency of resume result function
* Adopt the async main test setup
* More migration of tests to new async mechanisms
* Handle the double finish/throw case
* Ensure the dependency on Dispatch is built for the series tests (due to semaphore usage)
* Add import-libdispatch to run command for Series tests
* Use non-combine based timeout intervals (portable to linux) for dispatch semaphore
* Rename Series -> AsyncStream and resume functions to just yield, and correct a missing default Element.self value
* Fix missing naming change issue for yielding an error on AsyncThrowingStream
* Remove argument label of buffering from tests
* Extract buffer and throwing variants into their own file
* Slightly refactor for only needing to store the producer instead of producer and cancel
* Rename onCancel to onTermination
* Convert handler access into a function pair
* Add finished states to the termination handler event pipeline and a disambiguation enum to identify finish versus cancel
* Ensure all termination happens before event propigation (and outside of the locks) and warn against requirements for locking on terminate and enqueue
* Modified to use Deque to back the storage and move the storage to inner types; overall perf went from 200kE/sec to over 1ME/sec
* Update stdlib/public/Concurrency/AsyncStream.swift
Co-authored-by: Doug Gregor <[email protected]>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Doug Gregor <[email protected]>
* Update stdlib/public/Concurrency/AsyncStream.swift
Co-authored-by: Joseph Heck <[email protected]>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Joseph Heck <[email protected]>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Joseph Heck <[email protected]>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Joseph Heck <[email protected]>
* Update stdlib/public/Concurrency/AsyncStream.swift
Co-authored-by: Joseph Heck <[email protected]>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Joseph Heck <[email protected]>
* Remove local cruft for overlay disabling
* Remove local cruft for Dispatch overlay work
* Remove potential ABI impact for adding Deque
Co-authored-by: Doug Gregor <[email protected]>
Co-authored-by: Joseph Heck <[email protected]>1 parent 93eae81 commit 4886bd5
File tree
9 files changed
+1664
-274
lines changed- stdlib/public/Concurrency
- test/Concurrency/Runtime
9 files changed
+1664
-274
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
0 commit comments