Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asynccallguard

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

asynccallguard

Make all calls to a function queued and asynchronously guarded

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

AsyncCallGuard Build Status

Make all calls to a function queued and asynchronously guarded

NPM

Install the module with: npm install asynccallguard

Usage

var AsyncCallGuard = require('asynccallguard');

var w  = 100;
var f  = function(){console.log(Array.prototype.slice.call(arguments));};
var f2 = AsyncCallGuard(f, function MyGuard(fcall){
  //
  // ... Some complex logic here...
  //
  w *= 2;
  console.log('MyGuard was called, waiting for '+w+'ms before running f');
  setTimeout(fcall, w);
});

// Make multiple calls
f2();
f2(1,2);
f2(3,4);
f2(5,6,7);

// Produce:
// MyGuard was called, waiting for 200ms before running f
// []
// MyGuard was called, waiting for 400ms before running f
// [ 1, 2 ]
// MyGuard was called, waiting for 800ms before running f
// [ 3, 4 ]
// MyGuard was called, waiting for 1600ms before running f
// [ 5, 6, 7 ]

Release History

v1.0.0 - Initial commit (13 apr. 2012)

License

Copyright (c) 2013 Francois-Guillaume Ribreau Licensed under the MIT license.

Keywords

FAQs

Package last updated on 13 Apr 2013

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

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