-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(batch): sequential async processing of records for `BatchProcess…
…or` (#3109) Co-authored-by: Andrea Amorosi <dreamorosi@gmail.com>
- Loading branch information
1 parent
39c8608
commit e31279a
Showing
6 changed files
with
533 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { | ||
BatchProcessor, | ||
EventType, | ||
processPartialResponse, | ||
} from '@aws-lambda-powertools/batch'; | ||
import type { SQSHandler, SQSRecord } from 'aws-lambda'; | ||
|
||
const processor = new BatchProcessor(EventType.SQS); | ||
|
||
const recordHandler = async (_record: SQSRecord): Promise<void> => { | ||
// Process the record | ||
}; | ||
|
||
export const handler: SQSHandler = async (event, context) => | ||
processPartialResponse(event, recordHandler, processor, { | ||
context, | ||
processInParallel: false, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.