Skip to content

Feature request: Idempotent attribute on another method #348

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

Closed
1 of 2 tasks
hossambarakat opened this issue Jul 9, 2023 · 0 comments · Fixed by #349
Closed
1 of 2 tasks

Feature request: Idempotent attribute on another method #348

hossambarakat opened this issue Jul 9, 2023 · 0 comments · Fixed by #349
Labels
feature-request New or enhancements to existing features triage Pending triage from maintainers

Comments

@hossambarakat
Copy link
Contributor

Use case

Support adding the Idempotent attribute on any sub method, not only the Lambda handler

Solution/User Experience

Update the IdempotentAttribute to get payload based on the following:

  • If the method only has one parameter, it will be used by default.
  • If there are 2 or more parameters, consumer must set the IdempotencyKey attribute on the parameter to use.
    public class Function
    {
        public Function()
        {
            Idempotency.Configure(builder => builder.UseDynamoDb("idempotency_table"));
        }
        
        public Task<string> FunctionHandler(string input, ILambdaContext context)
        {
            dummpy("hello", "world")
            return Task.FromResult(input.ToUpper());
        }

        [Idempotent]
        private string dummy(string argOne, [IdempotencyKey] string argTwo) {
            return "something";
        }
    }

This will provide feature parity with Powertools (Java & Python)

Alternative solutions

No response

Acknowledgment

@hossambarakat hossambarakat added feature-request New or enhancements to existing features triage Pending triage from maintainers labels Jul 9, 2023
@hjgraca hjgraca linked a pull request Jul 10, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New or enhancements to existing features triage Pending triage from maintainers
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant