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

Maintenance: revisit async/sync processing for batch utility #1603

Closed
1 of 2 tasks
dreamorosi opened this issue Jul 11, 2023 · 2 comments · Fixed by #1616
Closed
1 of 2 tasks

Maintenance: revisit async/sync processing for batch utility #1603

dreamorosi opened this issue Jul 11, 2023 · 2 comments · Fixed by #1616
Assignees
Labels
batch This item relates to the Batch Processing Utility completed This item is complete and has been merged/shipped internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)

Comments

@dreamorosi
Copy link
Contributor

Summary

The current implementation of the Batch Processing utility allows you to register an handler function that is executed for each record in a batch. This function can be both synchronous and asynchronous. In order to allow for async functions the current process() method has been implemented as async and always returns a Promise.

This requires the caller to have to await the result and handle the promise. When the caller passes a synchronous handler this might result counterintuitive, even though the addition of a Promise technically is a no-op.

This discussion arose during the review of the first PR for the utility (here), however at that time it was too early to make a decision and so we have decided to postpone the topic until later in the implementation.

Why is this needed?

So that we can review whether the current implementation is appropriate and decide if we need to change the types, add a new methods to distinguish between sync/async processing, or split the classes entirely.

Which area does this relate to?

Other

Solution

No response

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

@dreamorosi dreamorosi added internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) confirmed The scope is clear, ready for implementation batch This item relates to the Batch Processing Utility labels Jul 11, 2023
@am29d am29d added this to the Batch processing - Beta release milestone Jul 12, 2023
@dreamorosi dreamorosi self-assigned this Jul 16, 2023
@dreamorosi dreamorosi linked a pull request Jul 16, 2023 that will close this issue
9 tasks
@github-actions github-actions bot added pending-release This item has been merged and will be released soon and removed confirmed The scope is clear, ready for implementation labels Jul 19, 2023
@github-actions
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 25, 2023

This is now released under v1.12.1 version!

@github-actions github-actions bot added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
batch This item relates to the Batch Processing Utility completed This item is complete and has been merged/shipped internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)
Projects
Development

Successfully merging a pull request may close this issue.

2 participants