othiym23/async-listener — pull request #5 by jacobgroundwater (2013-10-13 19:03:16+00:00)
Title: pass wrapped function to onAsync function

Just and idea I had.

Pass the function being wrapped to your `onAsync` function. This is mostly useful for debugging purposes.

```javascript
function onAsync(f) {
process._rawDebug('async function %s scheduled', f.name);
return f.name;
}

var handleTrace = {
before: function before(context, trace) {
process._rawDebug('before async function %s invoked', trace);
},
after: function after(context, trace, returnVal) {
process._rawDebug('after async function %s invoked', trace);
},
error: function error(trace, err) {
process._rawDebug('error in async function %s invoked', trace);
}
};

process.addAsyncListener(onAsync, handleTrace);
```