Skip to content

Feature request: make async batch processor default one #1677

Closed
@dreamorosi

Description

@dreamorosi

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.

Metadata

Metadata

Assignees

Labels

batchThis item relates to the Batch Processing UtilitycompletedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utility

Type

No type

Projects

Status

Shipped

Relationships

None yet

Development

No branches or pull requests

Issue actions