-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Observation] Proposal to add a transactional observation of values #2726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
heckj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes a few grammar typos
| `AsyncSequence` of values emitted from changes to a property on a given model | ||
| type. For example, DockKit provides `trackingStates` and Group Activities | ||
| provides `localParticipantStates`. These are much like other APIs that provide | ||
| `AsyncSequence` from a model type; they hand crafted to provide events from when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `AsyncSequence` from a model type; they hand crafted to provide events from when | |
| `AsyncSequence` from a model type; they are hand crafted to provide events from when |
| prime for the next call to the iterator's `next` method. | ||
|
|
||
| The closure has two other features that are important for common usage; firstly | ||
| the closure is typed-throws such that any access to that emission closure will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| the closure is typed-throws such that any access to that emission closure will | |
| the closure uses typed-throws such that any access to that emission closure will |
…aviors and potential edge cases
|
@Jumhyn I added a new section for |
|
|
||
| Numerous frameworks in the Darwin SDKs provide APIs for accessing an | ||
| `AsyncSequence` of values emitted from changes to a property on a given model | ||
| type. For example, DockKit provides `trackingStates` and Group Activities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that (AFAICT) the cited examples are closed source, it's not self-evident that they have semantics compatible with what's being proposed here. are you asserting that they do – i.e. these API could be re-implemented with the proposed Observed type? are there open source examples that could be used here instead?
…version for explicitly constructing Observed untilFinished
…acked values over time (#79817) This is an implementation for the feature swiftlang/swift-evolution#2726
…acked values over time (swiftlang#79817) This is an implementation for the feature swiftlang/swift-evolution#2726
…acked values over time (#79817) (#82197) - **Explanation**: This is an implementation for the feature swiftlang/swift-evolution#2726 - **Scope**: This is targeted specifically to the Observation module, no language or runtime changes - **Issues**: - **Original PRs**: #79817 - **Risk**: Low - **Testing**: This was tested in external forms (which need to be merged in) - **Reviewers**: --------- Co-authored-by: Stephen Canon <[email protected]>
This proposal contains a modification to the Observation module that adds a new type. This type is an
AsyncSequencethat produces values over time by tracking transactional changes to@Observablemarked types.