New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lambda-continue

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-continue

Chaining lambda calls

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

lambda-continue

Chaining lambda call to beat 15minutes execution

Installation

npm i --save lambda-continue

Usage

import { createHandler } from 'lambda-continue'

// Your lambda Handler
export const handler = (event, context) => {
  const payload_a = event.body?.payload_a
  const h = createHandler((offset, continueContext) => {
    // do your stuff continue from given offset.
    for(const i = offset; i < 100000000; i++) {
      // Halt if needed.
      if (continueContext.shouldStop()) {
        return i
      }

      await continueContext.assertCancellation(offset)

      // do long running process here!
    }
  }, {
    cycleMinutes: 12,           // execute at maximum 12 minutes per cycle
    cycleAllowed: 3,            // execute at maximum 3 times
    lambdaFunctionName: 'Your-Lambda-Function-Name!',
    extraPayload: {
      payload_a: payload_a,    // Keep passing the original payloads to make sure our next execution keep going with the correct parameters.
    },
    lambda: new AWS.Lambda(),   // customize your Lambda here!
  }))

  return h(event, context)
}

Keywords

FAQs

Package last updated on 22 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc