Commit Graph
65 Commits
Author SHA1 Message Date
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
Philippe Hausler a6ad9b82e9 Conditional conformance for Sendable for throttle types (#52) 2022-02-18 16:44:26 -08:00
Philippe Hausler 5bfab6f07a Add a timer based async sequence (#54)
* Support cancellation for marble diagrams

* Add a timer based async sequence

* Test skewing events by sleeps inside the map

* A less confusing skew cancellation tick
2022-02-18 16:44:07 -08:00
Philippe Hausler aebc7af342 instant math for throttle 2022-02-18 00:07:55 -08:00
Philippe Hausler 46b3bb088b implement a sequence for throttling incoming rates to a minimum spaced duration (#41)
* implement a sequence for throttling incoming rates to a minimum spaced duration

* Add delayed emission tests for throttle
2022-02-18 00:06:06 -08:00
Philippe Hausler d96606e7f7 Clean up the marble diagram implementation and factor it into a per Task based queue system (#44)
* Split the marble diagram code out into their own files for easier refactoring

* Update latest landing InstantProtocol definition stub

* Migrate to a per Task based queue system to avoid blocking valid future jobs

* Factor inputs to be specialized waits for side tracking

* Add grouping support

* Add tests for grouping and parse failures

* Fixup misstep in package definition for clock stub imports for the marable diagrams

* Add descriptions for partial iterations for debugging aides

* Simplify Task.select implementation to handle continuations more encapsulatedly

* Add descriptions for WorkQueue items for debugging and use stable work queue drains
2022-02-18 00:05:36 -08:00
Philippe Hausler 303e6a9b15 Add marble diagrams for merge and correct partial state transitions (#42) 2022-02-18 00:04:44 -08:00
Philippe Hausler 47aa4ccba6 A continuous form of reduce and a throwing variant of that reduction (#35) 2022-02-08 10:16:17 -08:00
Philippe Hausler d905d2a465 Async on both send and iteration subject like behavior (#34)
* Async on both send and iteration subject like behavior

* rename the initial state to idle for subjects
2022-02-01 09:21:06 -08:00
Philippe Hausler 7e3b1c1164 Add a 2 and 3 arity version of combineLatest (#20) 2022-01-25 13:14:38 -08:00
Philippe Hausler 18fcfe8e29 [NFC] Fixup attribution dates in comments (#22) 2022-01-25 09:52:32 -08:00
Philippe Hausler ad2d2fca7e Add a stub implementation of the clock/instant/duration (#26) 2022-01-24 17:40:20 -08:00
kperryua 4c93fa2c87 Merge pull request #17 from apple/pr/joined
Add a sequence for joining multiple async sequences with separators
2022-01-24 17:24:23 -08:00
Philippe Hausler 21520e710c Rework Task.first to a better name/behavior of Task.select (#21)
* Rework Task.first to a better name/behavior of Task.select

* Downgrade UnsafeResumption to internal
2022-01-24 13:38:51 -08:00
Kevin Perry 8c93e6ba6c Add a sequence for joining multiple async sequences with separators 2022-01-21 13:14:42 -08:00
Philippe Hausler 34682caadf AsyncChainSequences should be Sendable if their bases are Sendable (#15) 2022-01-21 12:32:36 -08:00
Philippe Hausler 3883a4033b Remove Codable, Hashable, and Equatable conditional conformance (#16) 2022-01-21 12:32:21 -08:00