Class Interface
Defined in: | src/lib/taskgroup.coffee |
Inherits: | EventEmitter |
Overview
Subclasses
Instance Method Summary
- ::complete() Fire our completion event.
- ::constructor() Adds support for the done event while ensuring that errors are always handled correctly.
- ::done(args...) Alias for ::onceDone
- Object ::getConfig() Get the configuration of our instance.
- String ::getName() Get the name of our instance.
- String ::getNames(opts = {}) Get our name with all of our parent names into a String or Array.
-
::onceDone(listener)
Attaches the listener to the
done
event to be emitted only once, then removed to not fire again. -
::whenDone(listener)
Attaches the listener to the
done
event to be emitted each time.
Constructor Details
::constructor() Source
Adds support for the done event while ensuring that errors are always handled correctly.
It does this by listening to the error
and completed
events,
and when the emit, we check if there is a done
listener:
- if there is, then emit the done event with the original event arguments
- if there isn't, then output the error to stderr and throw it.
Instance Method Details
::complete() Source
Fire our completion event.
::done(args...) Source
Alias for ::onceDone
Object ::getConfig() Source
Get the configuration of our instance.
String ::getName() Source
Get the name of our instance.
If the name was never configured, then return the name in the format of
'#{@type} #{Math.random()}'
to output something like task 0.2123
String ::getNames(opts = {}) Source
::onceDone(listener) Source
Attaches the listener to the done
event to be emitted only once, then removed to not fire again.
::whenDone(listener) Source
Attaches the listener to the done
event to be emitted each time.