I am currently in the process of developing an API service that allows any client to provide me with their HTTP request along with the desired time in seconds for execution. I have considered two potential approaches to achieve this:
- Utilizing a lambda function with nodeJS and implementing setTimeout to introduce a delay before executing the HTTP request.
- Creating a step function that waits for a specified number of seconds before triggering my lambda function to execute the HTTP request.
My main goal is to evaluate the advantages and disadvantages of each method. While using setTimeout seems simple and does not present any obvious issues, I am curious if there are specific reasons why opting for step functions would be beneficial?