Closed
Description
What were you searching in the docs?
I was looking into ways to combine Idempotency utility and Batch utility.
Is this related to an existing documentation section?
How can we improve?
The code sample using batch_processor
decorator has the following calling order, where save_inprogress
is called before register_lambda_context
is called.
batch_processor -> idempotent_function -> save_inprogress -> record_handler -> idempotent_function -> save_inprogress -> dummy -> register_lambda_context
Got a suggestion in mind?
Shouldn't we change to using context manager instead of decorator?
Also, shouldn't the dummy call be after register_lambda_context?
def handler(event, context):
config.register_lambda_context(context) # see Lambda timeouts section
# `data` parameter must be called as a keyword argument to work
dummy("hello", "universe", data="test")
batch = event["Records"]
with processor(records=batch, handler=record_handler):
processor.process()
return processor.response()
Acknowledgment
- I understand the final update might be different from my proposed suggestion, or refused.