npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bull-stepfunction

v1.0.17

Published

run bullQ job like AWS stepfunction

Downloads

31

Readme

bull-stepfunction

GitHub License GitHub Issues

A Node.js module for controlling queues and jobs using StepFunction JSON format with Bull queues.

Table of Contents

Introduction

bull-stepfunction is a Node.js module that provides the ability to control queues and jobs using StepFunction JSON format. It leverages the power of Bull queues to manage asynchronous tasks and offers an intuitive way to structure job execution using StepFunction-like syntax.

Features

  • Define job sequences using StepFunction JSON format.
  • Integrate with Bull queues for efficient job processing.
  • Improved control over complex job workflows.

Installation

You can install bull-stepfunction using npm:

npm install bull-stepfunction

Usage

const {StepFunction} =require("bull-stepfunction");
const Queue =require("bull");
const path =require("path");

const testjobQ = require("./testJob")
const testjobQ1 = require("./testJob1")
const testjobQ2 = require("./testJob2")

const testQ = new Queue("fetch", "redis://127.0.0.1:6381");
const testQ1 = new Queue("fetch1", "redis://127.0.0.1:6381");
const testQ2 = new Queue("fetch2", "redis://127.0.0.1:6381");


testQ.process(20, testjobQ)
testQ1.process(20, testjobQ1)
testQ2.process(20, testjobQ2)

let sf = new StepFunction(path.join(__dirname, './simple.asl.json'),{testjob:testQ,testjob1:testQ1,testjob2:testQ2},{loging:false,redis:"redis://127.0.0.1:6381"})
sf.init({d:[{ss:"ss"},{dd:"dd"},{ff:"ff"}]})

sf.on('complete',(result)=>{
    console.log("step function process has been finished , final result is :",result)
})

first we import package with

const {StepFunction} =require("bull-stepfunction");

after that we define it with new StepFunction

let sf = new StepFunction(path.join(__dirname, './simple.asl.json'),{testjob:testQ,testjob1:testQ1,testjob2:testQ2},{loging:false,redis:"redis://127.0.0.1:6381"})

this will get three arguments

  • path of stepfunction json
  • the object map job from asl.json to job queue you defined in code
  • redis and loging configuration

after that we init the class with data we want to pass to it

sf.init({d:[{ss:"ss"},{dd:"dd"},{ff:"ff"}]})

and we could run code in complete event

sf.on('complete',({workflowId,data})=>{
    console.log("step function process has been finished ")
})

Examples

For more examples, please check the examples directory.

Contributing

Contributions are welcome! Please read the Contributing Guidelines for more information.