Socket
Book a DemoInstallSign in
Socket

@corva/node-scheduled-stream-lambda

Package Overview
Dependencies
Maintainers
8
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@corva/node-scheduled-stream-lambda

Generic lambda class for constructing scheduled stream data apps.

latest
npmnpm
Version
5.0.1
Version published
Weekly downloads
0
-100%
Maintainers
8
Weekly downloads
 
Created
Source

node-scheduled-stream-lambda

Scheduled stream lambda class for constructing data apps that run on schedule and handle streams.

ToC

  • node-scheduled-stream-lambda

Requirements

  • node.js - >=12.0.0

Getting started

Installation

npm i @corva/node-scheduled-stream-lambda

Features

  • Defines scheduled stream workflow

Examples

const { ScheduledStreamLambda } = require('@corva/node-scheduled-stream-lambda');

// you may need api client and other libs
const { ApiClient } = require('@corva/node-api-client');
const apiClient = new ApiClient();

const lambda = new ScheduledStreamLambda({
  apiClient,
  process: async ({ event, context }) => {
    const result = event.a + event.b;
    return result;
  },
});

Scheduled stream event

Scheduled stream event could look like this:

const event = [
  [
    {
      type: 'data_app',
      collection: 'activity-groups',
      cron_string: '*/5 * * * *',
      environment: 'qa',
      app: 1,
      app_key: 'corva.activity-group',
      app_version: '0.0.1',
      app_connection: 12345,
      source_type: 'drilling',
      company: 1,
      provider: 'corva',
      api_url: 'https://some-url',
      api_key: 'activity-group-key',
      schedule: 116027101,
      interval: 300,
      schedule_start: 1575970800000,
      schedule_end: 1575971100000,
      asset_id: 1,
      asset_name: 'My Asset',
      asset_type: 'Well',
      timezone: 'America/Chicago',
    }, 
    {
      type: 'data_app',
      collection: 'activity-groups',
      cron_string: '*/5 * * * *',
      environment: 'qa',
      app: 1,
      app_key: 'corva.activity-group',
      app_version: '0.0.1',
      app_connection: 12345,
      source_type: 'drilling',
      company: 1,
      provider: 'corva',
      api_url: 'https://some-url',
      api_key: 'activity-group-key',
      schedule: 116027102,
      interval: 300,
      schedule_start: 1575971100000,
      schedule_end: 1575971400000,
      asset_id: 1,
      asset_name: 'My Asset',
      asset_type: 'Well',
      timezone: 'America/Chicago',
    }
  ]
];

Keywords

lambda

FAQs

Package last updated on 29 Jan 2021

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