Feature request: make async batch processor default one #1677
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
Milestone
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
andAsyncBatchProcessor
.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 aSyncBatchProcessor
. This is in line with how other Node.js own libraries also behave. For instance most of thefs
(file system) functions are async and have corresponding sync versions, i.e.readFile
that returns aPromise
&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 calledBatchProcessor
should instead becomeSyncBatchProcessor
orBatchProcessorSync
(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.
The text was updated successfully, but these errors were encountered: