powertools-lambda-python icon indicating copy to clipboard operation
powertools-lambda-python copied to clipboard

Feature request: Idempotent decorator for asynchronous functions

Open esthermcmahon opened this issue 8 months ago • 2 comments

Use case

Would love to be able to use the AsyncBatchProcessor and async_process_partial_response function along with the idempotency utility.

Solution/User Experience

def async_idempotent_function():
    def wrapper(func):
        @functools.wraps(func)
        async def wrapped(*args):
            return await func(*args)
        return wrapped
    return wrapper

Alternative solutions

No response

Acknowledgment

esthermcmahon avatar Jun 10 '24 21:06 esthermcmahon