

Deadbolt - autoreleasing locks for node.js - indutny
https://github.com/indutny/deadbolt

======
iambot
Could someone please explain to me what this does. I've looked at the repo and
the readme, and I dabble in nodejs. But to be honest I have no idea what this
does or helps one do.

~~~
indutny
It does locks management and some autoreleasing black magic.

Lets image you have a `callback` variable that you want to pass to some 3rd
party code and you ain't sure whether it'll call it or not (or you're aware
that unhandled exception may be thrown inside it). If you'll wrap `callback`
with `deadbolt.wrap(callback)` and pass it to that function, `callback` will
be called with a error if it will become not referenced (see
[http://en.wikipedia.org/wiki/Garbage_collection_(computer_sc...](http://en.wikipedia.org/wiki/Garbage_collection_\(computer_science\))
) in that 3rd party code.

~~~
iambot
ah thanks very much, so its a way of being alerted as to whether my callback
has been ignored/lost.

~~~
indutny
yes. I did that because in one of my projects 3rd party code was rarely
throwing exceptions that I could not caught and incoming request was hanging
for a minutes (and after that overall app's state was inconsistent)

