generated from amazon-archives/__template_MIT-0
- Notifications
You must be signed in to change notification settings - Fork 460
feat: SQS Partial failure #100
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
Merged
heitorlessa merged 26 commits into aws-powertools:develop from gmcrocetti:partial-sqs-batch Sep 1, 2020
Merged
Changes from 1 commit
Commits
Show all changes
26 commits Select commit Hold shift + click to select a range
2e00554 feat: add batch module
gmcrocetti 9015d43 feat: include base processors
gmcrocetti 48a7687 feat: add sqs failure processors
gmcrocetti 9c7324b fix: include proposed suggestions
gmcrocetti e7e36a9 feat(sqs): improve validation for queue_url
gmcrocetti 8dbaf67 feat: add package level import for batch utility
gmcrocetti 524d27f refactor: change return for failure/success handlers
gmcrocetti 7d32e8c test: add unit tests for partial sqs processor
gmcrocetti f9c53e0 test: add unit tests for partial sqs processor
gmcrocetti 680ee69 test: functional tests for partial sqs processor and its middleware
gmcrocetti 6cddf76 feat(sqs): add optional config parameter
gmcrocetti 13e3132 refactor(tests): processor using default config
gmcrocetti 4275fb2 refactor(sqs): change methods to protected
gmcrocetti 54a76df fix(base-partial): append record instead of entry
gmcrocetti 438ecd5 docs(sqs): docstrings for PartialSQS
gmcrocetti c7582f3 docs(sqs-base): docstring for base class
gmcrocetti f419ef6 refactor(sqs): add module middlewares
gmcrocetti c999f96 refactor: changes partial_sqs middleware in favor of a generic interf…
gmcrocetti 5cb6b89 refactor(tests): update tests to new batch processor middleware
gmcrocetti be06149 refactor: batch middleware
gmcrocetti 8ba81b4 docs(partial-processor): add simple docstrings to success/failure han…
gmcrocetti edcc14a fix: typo in example
gmcrocetti ded3d75 docs: user specific documentation
gmcrocetti 14cc383 docs: fix suggestions made by @heitorlessa
gmcrocetti 25d67ca refactor: remove references to BaseProcessor. Left BasePartialProcessor
gmcrocetti 9caf3d1 docs: refactor example; improve docs about creating your own processor
gmcrocetti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor(sqs): add module middlewares
- Loading branch information
commit f419ef61f4031c857668b9c4123378971bcc0140
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,29 @@ | ||
| # -*- coding: utf-8 -*- | ||
| | ||
| """ | ||
| Middlewares for batch utilities | ||
| """ | ||
| from typing import Callable, Dict | ||
| | ||
| from aws_lambda_powertools.middleware_factory import lambda_handler_decorator | ||
| | ||
| from .sqs import PartialSQSProcessor | ||
| | ||
| | ||
| @lambda_handler_decorator | ||
| def partial_sqs_processor( | ||
| handler: Callable, event: Dict, context: Dict, record_handler: Callable, processor: PartialSQSProcessor = None | ||
| ): | ||
| """ | ||
| | ||
| Examples | ||
| -------- | ||
| | ||
| """ | ||
| records = event["Records"] | ||
| processor = processor or PartialSQSProcessor() | ||
| | ||
| with processor(records, record_handler) as ctx: | ||
| ctx.process() | ||
| | ||
| return handler(event, context) | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.