Description
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
- This feature request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status