Commit Graph
81 Commits
Author SHA1 Message Date
Thibault Wittemberg 9baff2ad3d [AsyncThrowingChannel] make the fail terminal event non async (#164)
* asyncThrowingChannel: make fail set a terminal state

* asyncChannel: align naming on asyncThrowingChannel

* asyncChannel: remove a test base on Task.sleep

* guides: update Channel with non async fail(_:)
2022-06-27 09:04:37 -07:00
Ole Begemann 8a355f015f Fix a few typos (#173) 2022-06-27 09:03:09 -07:00
shiz 816cf644af Add missing back quote (#171) 2022-06-27 09:00:33 -07:00
Philippe Hausler 434591a571 Update availability to be in sync with Clock/Instant/Duration (#159) 2022-06-13 10:18:45 -07:00
Max Desiatov 6e9a5757bc Fix typo in BufferedBytes.md (#158)
`BufferedAsyncByteIterator` -> `AsyncBufferedByteIterator`
2022-05-30 19:29:53 -07:00
Thibault Wittemberg a973b06d06 Fix async channel finishes all (#152)
* asyncChannel: enforce termination for all when finished

* asyncThrowingChannel: enforce termination for all when finished

* asyncChannel: improve unit tests readability

* asyncChannel: adapt the Guide to the new finish behaviour

* asyncChannel: adapt the Guide to the new finish behaviour
2022-05-04 13:07:33 -07:00
Kevin Tan 6b59cfb8d0 Minor documentation improvements (#153) 2022-05-03 21:17:53 -07:00
Thibault Wittemberg 6d5d6319f4 asyncThrowingChannel: fixes potential crashes when no more awaiting (#150)
This commit fixes crashes where the state is "awaiting" with no more awaiting clients.
The state is now set to .idle to reflect the reality.
2022-04-21 11:10:14 -07:00
Thibault Wittemberg 047ab6abef asyncChannel: fixes potential crashes when no more awaiting (#143)
This commit fixes crashes where the state is "awaiting" with no more awaiting clients.
The state is now set to .idle to reflect the reality.
2022-04-15 10:05:40 -07:00
Tiago Lopes d2164b9ef6 Fix redundant where clauses in AsyncBufferSequence extension (#141) 2022-04-12 07:23:05 -07:00
Tiago Lopes 5b78eaf423 Fix some typos in Chain.md (#144) 2022-04-11 15:06:39 -07:00
Kyle a3576e669b Add docc support and publish documentation to GitHub pages (#137)
* Move Guides into docc base location

* Add Github gh-page support

* Conditionally add docc-plugin dependency

* Temp skip AsyncSequenceValidation target
2022-04-11 14:25:33 -07:00
Philippe Hausler 6a8aec2a1f #131 Cancel sends as if they were terminal events on task cancellation (#132) 2022-04-08 10:44:30 -07:00
Philippe Hausler 9d03d90a13 #120 Ensure concurrent access to AsyncBufferedByteIterator does not crash from dangling pointers (#121) 2022-04-08 10:44:06 -07:00
Philippe Hausler 18749897a8 #113 Define the first element of throttled sequences by not exceeding the rate (and fix a expectation misalignment of events) (#133)
* #113 Define the first element of throttled sequences by not exceeding the rate (and fix a expectation misalignment of events)

* Update guide for throttle referencing the first element and duration measurement
2022-04-01 11:40:44 -07:00
Laszlo Teveli b8a8d5d2ae Rename AdjacentPairsSequence.swift (#126) 2022-03-29 12:15:04 -07:00
Laszlo Teveli b136d48e7f Adjacent Pairs (#111) 2022-03-29 10:01:55 -07:00
Reza Shirazian 0dfb244b1b Fixing a few typos (#115)
This PR fixes a few typos across various comments in the code.
2022-03-27 08:19:52 -07:00
jamieQ 1656fd8839 Fix typo in AsyncChannel documentation (#108)
fix typo
2022-03-25 14:49:10 -07:00
Philippe Hausler db847ef410 Remove shims for use with the swift development toolchains (#105) 2022-03-24 16:03:21 -07:00
Philippe Hausler 98d4229317 Add shims and adjust availability to allow for swift 5.6 toolchains to build until source stability is achieved (#100)
* Add shims and adjust availability to allow for swift 5.6 toolchains to build until source stability is achieved

* Restore availability again
2022-03-24 12:09:07 -07:00
Chris AdamsonandChris Adamson 33494899af Light edit of recent doc comments. (#98)
Co-authored-by: Chris Adamson <cadamson@apple.com>
2022-03-22 10:05:21 -04:00
Philippe Hausler 718d647945 Add a smattering of brief inline docs for most functions/types (#97) 2022-03-18 15:15:55 -07:00
kperryua d4bdb34283 Add a no-separator variant of joined() to match the stdlib (#87)
* Add a no-separator variant of joined() to match the stdlib

* @inlinable and @frozen
2022-03-18 14:04:00 -07:00
Philippe Hausler 11d7cfe1c9 First pass at some documentation for chunked/chunks (#92)
* First pass at some documentation for chunked/chunks

* Manually line break docs
2022-03-18 14:03:46 -07:00
Philippe Hausler b11a32fe4e First pass at some documentation for combineLatest (#94)
* First pass at some documentation for combineLatest

* Add additional docs for extension methods and AsyncCombineLatest2Sequence structure
2022-03-18 13:32:15 -07:00
Philippe Hausler f560d1c61f First pass at some documentation for debounce (#95)
* First pass at some documentation for debounce

* Add additional docs for extension methods and iterator
2022-03-18 13:31:40 -07:00
Philippe HauslerandChris Adamson bcd0ee1e50 [WIP] First pass at some documentation for AsyncChannel (#91)
* First pass at some documentation for AsyncChannel

* Apply suggestions from code review

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Manually line break docs

Co-authored-by: Chris Adamson <invalidname@gmail.com>
2022-03-18 11:39:45 -07:00
Philippe HauslerandChris Adamson 37ad908591 First pass at some documentation for AsyncBufferSequence (#90)
* First pass at some documentation for AsyncBufferSequence

* Apply suggestions from code review

Co-authored-by: Chris Adamson <invalidname@gmail.com>

Co-authored-by: Chris Adamson <invalidname@gmail.com>
2022-03-18 11:39:32 -07:00
Philippe HauslerandChris Adamson b8b04919e4 slight adjustments to make docc rendering of AsyncBufferedByteIterator documentation nicer (#93)
* slight adjustments to make docc rendering of AsyncBufferedByteIterator documentation nicer

* Apply suggestions from code review

Co-authored-by: Chris Adamson <invalidname@gmail.com>

Co-authored-by: Chris Adamson <invalidname@gmail.com>
2022-03-18 10:22:00 -07:00
4d4022e91b Add a whole bunch more to the guides (#64)
* Rebase guides WIP to avoid source changes

* Add prose for debounce and throttle

* Add an alterantive for debounce

* Starts to prose for reductions

* Add effect listings for all types

* Add some examples for reductions

* Update Guides/Channel.md

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Update Guides/Channel.md

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Update Guides/Channel.md

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Update Guides/Channel.md

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Update Guides/Collections.md

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Update Guides/Throttle.md

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Update Guides/Throttle.md

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Update Guides/Throttle.md

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Update Sources/AsyncAlgorithms/AsyncInclusiveReductionsSequence.swift

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Adjust events to elements for channels

* Add a bit more detail to the README and a start to the guide for Task.select

* Chunked updates

* Add a getting started section to the README

* Add some more prose for Channel

* Update Guides/RemoveDuplicates.md

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Apply suggestions from code review

Co-authored-by: Chris Adamson <invalidname@gmail.com>

* Add some brief prose for Compacted

* reductions could be named scan

* spelling and correctness fixes

* Apply @kperryua's suggestion for changing the intro of Compacted

* Add some brief prose for Timer

* Apply suggestions from code review for README

Co-authored-by: Tony Parker <anthony.parker@apple.com>

* Add some brief prose for RemoveDuplicates

* Fleshing out of `Joined`

Co-authored-by: Chris Adamson <invalidname@gmail.com>
Co-authored-by: Kevin Perry <kperry@apple.com>
Co-authored-by: Tony Parker <anthony.parker@apple.com>
2022-03-17 18:40:14 -07:00
Philippe Hausler e87e9ddd02 Reduce warnings for preconcurrency and non mutated vars (#88) 2022-03-17 16:13:57 -07:00
Chris AdamsonandChris Adamson 5ac8bb4d07 Light edit on guides and sequence source docs (rdar://90176127) (#86)
* Light-touch edit on existing guides.

* Light edit on the sequences' source docs.

Co-authored-by: Chris Adamson <cadamson@apple.com>
2022-03-17 15:14:34 -07:00
Philippe Hausler 571bfd1a60 Add an implementation of inclusive reductions (#81) 2022-03-15 13:08:15 -07:00
Philippe Hausler 822ca9365c Restore availability and mark everything as 9999 to match stdlib availability for 5.7 for now (#82) 2022-03-15 09:21:51 -07:00
Kevin Perry ed1d2a04cf Fixed simple mistake from pr/buffer 2022-03-14 14:06:13 -07:00
Philippe HauslerandKevin Perry 6ba2c05cfa A full knobs-and-dials buffering strategy transformation (#61)
* A full knobs-and-dials buffering strategy transformation

* Refine the AsyncBuffer type to require actor and add some additonal tests for custom buffer types

* Migrate the internal state to an actor

* Remove default unbounded policy from buffers

* Remove some dead code tests and fix space removal to avoid superfluous checks

* Simplification of nominal state machine, which helps eliminate actor interleaving issues. Fixed error/termination handling. Validation diagram tests, using “delay next” operators

* Most robust behavior when multiple tasks are concurrently accessing the iterator

* Removed Envelope, added base iterator Sendable requirement, and added conditional Sendable conformances

* Minor future-proofing

Co-authored-by: Kevin Perry <kperry@apple.com>
2022-03-14 13:41:44 -07:00
Philippe Hausler f0f348a680 Unify naming of chunks a bit more (#74) 2022-03-14 11:47:07 -07:00
Philippe Hausler de73225ecc Resolve a race condition that caused repeated testing of channel cancellation to sometimes hang (#80)
* Resolve a race condition that caused repeated testing of channel cancellation to sometimes hang

* Better name for removal for cancellation in inner Async(Throwing)Channel
2022-03-14 11:37:02 -07:00
Philippe Hausler 0fda7f3e0b Add a label for consistency with AsyncThrowingChannel for the element type of AsyncChannel (#76) 2022-03-11 17:59:15 -08:00
Philippe Hausler 307118031e Remove clock stubs and use the _Concurrency provided Clock APIs (#78)
* Remove the clock stubs

* Add default implementations using clocks
2022-03-11 16:24:08 -08:00
Philippe Hausler 4b11faad62 Clean up some more warnings via an additional Sendability pass audit (#72) 2022-03-11 12:56:43 -08:00
Kevin Perry 625ac79d5f Tweaked signatures of chunks/chunked methods 2022-03-03 12:08:57 -08:00
Philippe Hausler 325923a5e6 Add a static method for constructing timers (#67) 2022-03-01 15:23:16 -08:00
Philippe Hausler 61bc878106 Add a performance tuned asynchronous iterator for creeating asynchronous byte sequences (#39)
* Add a performance tuned asynchronous iterator for creeating asynchronous byte sequences

* Some spelling fixes and language clarity improvements

* Add some more detail on the docs for the `AsyncBufferedByteIterator` initializer

* Move the storage to a usable from inline type
2022-03-01 13:25:55 -08:00
kperryua d90945abc8 Merge pull request #66 from apple/pr/chunked-collection-type-fix
Fixed element type of chunks(ofCount:collectedInto:)
2022-03-01 12:05:53 -08:00
Kevin Perry 7b62584d99 Fixed element type of chunks(ofCount:collectedInto:) 2022-03-01 12:03:32 -08:00
Philippe Hausler 2683ddc9c3 Rename to AsyncChannel (#63) 2022-03-01 09:11:37 -08:00
kperryua b8242c4a6b Add sequences that chunk values into collections based on a variety of criteria (#55)
* Add sequences that chunk values into collections based on a variety of criteria

* Factor out Merge2 logic so its termination behavior can be customized

* Rewrite AsyncChunksOfCountAndTriggerSequence in terms of the newly configurable merge state machine

* Name changes

* Fixed tests

* Enable chunked(byTime:) functions

* Broken up into one file per sequence
2022-02-23 17:17:20 -08:00
Philippe Hausler 4c35512ba6 implement a sequence for debouncing incoming events to an expected quiescence duration (#43)
* implement a sequence fir debouncing incoming events to an expected quiessence duration

* Ensure debouced sequences are sendable and update testing to the new validate method

* Add hangover tests and cancel sleep per iteration of production
2022-02-23 15:04:45 -08:00