Skip to content

Feature request: make async batch processor default one #1677

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

Closed
1 of 2 tasks
dreamorosi opened this issue Sep 13, 2023 · 2 comments · Fixed by #1683
Closed
1 of 2 tasks

Feature request: make async batch processor default one #1677

dreamorosi opened this issue Sep 13, 2023 · 2 comments · Fixed by #1683
Assignees
Labels
batch This item relates to the Batch Processing Utility completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility

Comments

@dreamorosi
Copy link
Contributor

Use case

When implementing the Batch Processing utility we have done so aligning with the signatures and patterns found in Python. This means we implemented two types of Batch Processing classes: BatchProcessor and AsyncBatchProcessor.

After spending some time with the library however we have realized that this is not the most idiomatic experience that we can offer since in JS/TS most modern the code is written using async/await and thus using asynchronous record handlers.

For this reason we propose to swap the two utilities name and have BatchProcessor be always async and instead have a SyncBatchProcessor. This is in line with how other Node.js own libraries also behave. For instance most of the fs (file system) functions are async and have corresponding sync versions, i.e. readFile that returns a Promise & readFileSync that instead expects a callback.

Solution/User Experience

From a customer perspective the main processor should be always called BatchProcessor and as part of this PR that processor should be made async. The other one, which is currently called BatchProcessor should instead become SyncBatchProcessor or BatchProcessorSync (with the latter aligning with existing Node.js modules mentioned above).

Alternative solutions

No response

Acknowledgment

Future readers

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

@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 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 Sep 18, 2023
@github-actions
Copy link
Contributor

This is now released under v1.13.0 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 Sep 18, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Sep 18, 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 feature-request This item refers to a feature request for an existing or new utility
Projects
2 participants