Commit Graph
30 Commits
Author SHA1 Message Date
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
kperryua b515cd8458 Merge pull request #14 from apple/pr/intersperse
Add a sequence that intersperses separator values
2022-01-21 12:10:06 -08:00
kperryua f614b51e55 Merge pull request #13 from apple/pr/remove-duplicates
Add a sequence for removing adjacent duplicates
2022-01-21 12:09:59 -08:00
Kevin Perry 93b868b59a Fixed comments 2022-01-21 12:09:07 -08:00
Kevin Perry 8295e01ac8 Add a sequence that intersperses separator values 2022-01-21 12:09:02 -08:00
Philippe Hausler 205414d19d Add a 2 and 3 arity version of merge with tuple backed storage (#8)
* Add a 2 and 3 arity version of merge with tuple backed storage

* Xcode really likes Metal, one could say the weighting for importing for that is heavy...
2022-01-21 11:52:37 -08:00
Philippe Hausler 0316ac34f3 Add a sequence for compacting nils (#6)
* Add a sequence for compacting nils

* Remove Codable, Hashable, and Equatable conditional conformance

* Add test for upstream throwing for compacted
2022-01-21 11:52:27 -08:00
Philippe Hausler d1a8f225eb Add documentation for AsyncLazySequence (#4) 2022-01-21 11:52:15 -08:00
Philippe Hausler 73b29b9cbf Add a 2 and 3 arity version of zip (#10) 2022-01-21 11:37:25 -08:00
Kevin Perry 8419f51fa6 Sendable conformance 2022-01-19 14:46:08 -08:00
Kevin Perry e7dc87d00c Add a sequence for removing adjacent duplicates 2022-01-19 14:46:08 -08:00
Philippe Hausler 8a1078810c Add a 2 and 3 arity version of chain (#9)
* Add a 2 and 3 arity version of chain

* Tests for cancellation of chain sequences

* Correct typo of missing [] in chain 3 test for cancellation

* Make chain 2/3 inlinable and frozen
2022-01-18 11:50:25 -08:00
Philippe Hausler 1c11d4a7c8 Add an algorithm to obtain the first result of a list of tasks (#5)
* Add an algorithm to obtain the first result of a list of tasks

* A much simpler and less risky implementation of Task.first that supports cancellation propigation

* Slight whitespace fix for Package.swift

* Demote Task.first to internal - revisit for better naming later as public
2022-01-14 08:25:41 -08:00
Philippe HauslerandNate Cook 1c08de7680 Add async rethrowing initializers for RangeReplaceableCollection, SetAlgebra, and Dictionary for use with AsyncSequence types (#3)
* Add async rethrowing initializers for RangeReplaceableCollection, SetAlgebra, and Dictionary for use with AsyncSequence types

* Add some additional tests for throwing coverage and documentation on collection initializers

* Spelling fix of unique

Co-authored-by: Nate Cook <natecook@apple.com>

* Spelling fix for unique (throwing version)

Co-authored-by: Nate Cook <natecook@apple.com>

Co-authored-by: Nate Cook <natecook@apple.com>
2022-01-14 08:23:14 -08:00
Philippe Hausler 2b4f602320 Add a primitive storage for managing critical state and platform abstracted locking (#7) 2022-01-13 16:18:50 -08:00
Philippe Hausler 361c7926d1 Add a package layout and initial implementation and tests for AsyncLazySequence (#2)
* Add a package layout and initial implementation and tests for AsyncLazySequence; a type for converting non asynchronous sequences into asynchronous ones

* Add a first iteration pass expectation to ensure that tasks spawn for testing cancellation of AsyncLazySequence

* Simplify the iterator for AsyncLazySequence
2022-01-11 10:26:32 -08:00