Skip to content

Latest commit

 

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blocking

Meteor smart package which makes node.js asynchronous functions blocking. It is assumed that the last argument of the function you want to make blocking is a standard callback which takes two arguments, an error value and a return value. Example:

blocking(function (a, b, cb) { cb(null, a + b) })(1, 2) === 3

In the case of an error, an exception is thrown. Additionally, an object to bind this can be passed. This is useful when wrapping object methods:

blocking(obj, obj.method)(42)

Adding this package to your Meteor application adds blocking function into the global scope which you can use to wrap an asynchronous function into a blocking function.

Server side only.

Installation

meteor add peerlibrary:blocking

Related projects

About

Making async functions blocking

Resources

Stars

9 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages