Socket
Book a DemoInstallSign in
Socket

track-sequence-ids

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

track-sequence-ids

if you are doing work related to sequence ids this tracks what you should store in your .sequence file.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

track-sequence-ids

if you are doing work related to sequence ids this tracks what you should store in your .sequence file.


var tracker = require('track-sequence-ids')
var write = require('write-file-atomic')

var startSequence = tracker(function saveSequence(sequence){

  write('.sequence',sequence,function(){
    //done. only gets called once with 2 but only after sequence 1 is complete
  })

})

var done = startSequence(1)

setTimeout(function(){
  done()
},1000)

var done2 = startSequence(2)

setTimeout(function(){
  done2()
},500)

this logic ensures that you cant accidentally save a sequence id higher than jobs you have yet to complete. it protects you from skipping jobs if you process multiple jobs at a time from the same queue.

FAQs

Package last updated on 24 May 2017

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