diff options
author | Operations Research Engineering Software+ <alex@oresoftware.com> | 2018-06-03 14:08:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-03 14:08:26 -0700 |
commit | eb3796a698e48d10b83b7b54a89f35110845cd56 (patch) | |
tree | 2c078f0c2d0379f2458024f00d581d3e9d06f3e8 | |
parent | 7f05f5c1d982d610f7535ed285e4c5ffa536f5d3 (diff) | |
download | async-eb3796a698e48d10b83b7b54a89f35110845cd56.tar.gz |
need to demonstrate error cb not just drain cb
need to demonstrate to users how to use a single error callback
-rw-r--r-- | lib/queue.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/queue.js b/lib/queue.js index 2ba1747..7a201c4 100644 --- a/lib/queue.js +++ b/lib/queue.js @@ -88,6 +88,11 @@ import wrapAsync from './internal/wrapAsync'; * console.log('all items have been processed'); * }; * + * // assign an error callback + * q.error = function(err, task) { + * console.error('task experienced an error'); + * }; + * * // add some items to the queue * q.push({name: 'foo'}, function(err) { * console.log('finished processing foo'); |