Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

concurrent-seq-file

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

concurrent-seq-file

makes it safe to work on multiple jobs identified by a sequence at the same time.

Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

concurrent-seq-file

makes it safe to work on multiple jobs identified by a sequence at the same time.

or more technically..

extends seq-file to save the lowest completed sequence number from active async processes.

var seq = require('concurrent-seq-file')('./test.seq')
var importantJob = require('some imaginary important job')

// stream that emits {seq:numeric id,doc:{}}
var follower = ... 

follower.on('data',function(obj){
  var done = seq(obj.seq)
  importantJob(function(){
    done()
  })
})

api

  • seq = module.exports(file[,options])

    • file - the file name to read the sequence from
    • options, optional
    • returns the seq function.
  • done = seq(sequenceId)

  • sequenceId is the next incrementing id number of the job you are starting.

  • returns done. call this when you are done with the job.

notes

job timeouts should be implemented on top of this module.

Keywords

seq

FAQs

Package last updated on 19 Oct 2015

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