recursive-lambda
recursive-lambda is a wrapper around recursive code called within AWS Lambda. It solves the problem of running out of execution time. Should a lambda hit the time limit, it will invoke new lambda so it could carry on with its business.
Example
;;{superparams lambdaClient context;this;}/*Specify logic that will be called recursively until termination logic is met.Ex: load DynamoDB records in batches, publish over SNS and repeat until done.*/{return this;}/*Specify when you want recursion to stop.If you don't overwrite parent implementation,your recursive function will be called exactly once*/{return thisstateexecutionCount < 4;}/*Specify execution threshold in milliseconds*/{return 200000;}{return {const executionCount = thisstateexecutionCount + 1;this;;};}
Contributing
Contributions are always welcome!
Developed by microapps Used in our live products: MoonMail & MONEI
License
recursive-lambda is available under the MIT license. See the LICENSE file for more info.