-
Notifications
You must be signed in to change notification settings - Fork 139
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
Feature request: idempotent decorator for Lambda handler #1306
Comments
We have decided to hold back the decorator and not include it in the beta release. Read more about why in #1375. |
EDIT: In the previous edit of this message I mistakenly referred to the deprecation of the Batch Processing decorator in Powertools for AWS (Python), now marked as "legacy", and mixed it with the Idempotency utility which has no plans of deprecating decorator-based usage. I regret the mistake and apologize for the confusion it might have caused. At the moment we are not planning on implementing the decorator for Idempotency in Powertools for AWS (TypeScript) but we are are open to reconsider this decision in the future if there's enough customer demand. For now we will remove it from the backlog. |
|
|
Use Case
Users who write their Lambda functions as classes should be able to make their function handler idempotent via decorator.
Solution/User Experience
The
idempotentHandler
decorator should be able to decorate anhandler
method of aLambdaInterface
class, bothasync
andsync
. The decorator should accept an object with mandatorypersistenceStore
and an optionalconfig
one. The former should be an instance of any class that extendsBasePersistenceLayer
, while the latter should be an instance of the classIdempotencyConfig
.Following the Powertools for Python implementation, the decorator should:
POWERTOOLS_IDEMPOTENCY_DISABLED
env variable has a truthy value (usingEnvironmentVariableService
)IdempotencyHandler
IdempotencyHandler.handle()
methodThis last step will ensure that the
IdempotencyHandler
will perform all the actions needed to make the function idempotent.Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: