Refactoring to ServerlessReplace Polling with Callback1 min
Description
Step Functions provide integration patterns to interact with services invoked. Waiting for a long-running process might lead users to build a polling workflows including control flows (e.g. Choice, Map, Wait) or calls made against other AWS services (e.g. LambdaInvoke). This would lead to the before architecture shown below where a Lambda function is invoked repeatedly after a specified wait period to continue with the workflow once the message was processed.
See the CDK implementation of this pattern in Typescript on GitHub
Considerations
Advantages
The Step function state machine workflow waits until the callback token is received. This abandons the need for a polling machanism and reduces the number of function integrations.
Applicability
The Wait for a Callback with the Task Token Integration Pattern is available for supported services only.
Gregor HohpeI contemplate and write about architecture strategy, cloud, and IT transformation. In between I - extract order from chaos - dive into the engine room to give the penthouse better IT strategies - fight relentlessly against unnecessary complexity and corporate politics I've been called the ''IT transformation jester'' - unbiased, trusted, influential, and witty.
Sindhu PillaiAs Regional SA Lead, I focus on enterprise Education Technology customers. In my role, I guide my SA team in the delivery and execution of complex technical solutions to support our customer's business and technical goals.