3 ms·
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
by indutny 15y ago
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_science) http://en.wikipedia.org/wiki/Garbage_collection_(computer_sc... ) in that 3rd party code.
- iambot 15y agoah thanks very much, so its a way of being alerted as to whether my callback has been ignored/lost.
- indutny 15y agoyes. 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)