Socket
Socket
Sign inDemoInstall

fastq

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastq - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

7

package.json
{
"name": "fastq",
"version": "1.1.1",
"version": "1.2.0",
"description": "Fast, in memory work queue",

@@ -33,6 +33,9 @@ "main": "queue.js",

"pre-commit": "^1.0.10",
"standard": "^4.2.1",
"standard": "^5.2.0",
"tap-spec": "^4.0.0",
"tape": "^4.0.0"
},
"dependencies": {
"reusify": "^1.0.0"
}
}
'use strict'
var reusify = require('reusify')
function fastqueue (context, worker, limit) {

@@ -10,4 +12,3 @@ if (typeof context === 'function') {

var cacheHead = new Task(context, release)
var cacheTail = cacheHead
var cache = reusify(Task)
var queueHead = null

@@ -22,4 +23,6 @@ var queueTail = null

function push (value, done) {
var current = next()
var current = cache.get()
current.context = context
current.release = release
current.value = value

@@ -42,20 +45,4 @@ current.callback = done

function next () {
var task = cacheHead
if (task.next) {
cacheHead = task.next
} else {
cacheHead = new Task(context, release)
cacheTail = cacheHead
}
task.next = null
return task
}
function release (holder) {
cacheTail.next = holder
cacheTail = holder
cache.release(holder)
var next = queueHead

@@ -77,6 +64,8 @@ if (next) {

function Task (context, release) {
function Task () {
this.value = null
this.callback = noop
this.next = null
this.release = noop
this.context = null

@@ -89,4 +78,4 @@ var self = this

self.callback = noop
callback.call(context, err, result)
release(self)
callback.call(self.context, err, result)
self.release(self)
}

@@ -93,0 +82,0 @@ }

@@ -0,0 +0,0 @@ # fastq  [![build status](https://secure.travis-ci.org/mcollina/fastq.png)](http://travis-ci.org/mcollina/fastq)

@@ -0,0 +0,0 @@ 'use strict'

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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