Skip to content
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

Feature: TransformMany Async #824

Merged
merged 15 commits into from
Jan 26, 2024

Conversation

dwcullop
Copy link
Member

@dwcullop dwcullop commented Jan 6, 2024

Description

Implements TransformManyAsync and TransformManySafeAsync for #461.
Creates a new operator implementation that is based on the implementation of MergeManyChangeSets but allows the child selector to be Async, allows for an optional error handler, and does "best effort" to try to minimize the number of changesets.

TransformMany will emit a single changeset with all of the added child values for each parent changeset. This is not ideal for the async version because each parent value added creates an async call. This would mean that no changeset could be emitted until all of the async operations have completed.

As a compromise, the new operator will use an atomic counter to determine how many async operations have completed (but not been processed) and will not emit a changeset until all completed operations have been processed. This changeset will be emitted even if there are async operations pending because there is no way to tell how they will take.

This should be a good balance between timely changesets and fewer changesets.

@dwcullop dwcullop marked this pull request as ready for review January 14, 2024 01:10
@dwcullop dwcullop self-assigned this Jan 25, 2024
@dwcullop dwcullop merged commit dac44e1 into reactivemarbles:main Jan 26, 2024
1 check passed
@dwcullop dwcullop deleted the feature/transform-many-async branch January 26, 2024 19:04
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants