Returns an instance of Sequence
opts
autoRetry
determines if it should continue execution after all deps are ready, if true, it retries by passing the result to the function labeled as 'asynchronousExecutionCatcher' passed torun()
. If it's not labeled or present, it usesdefAEC
. Default istrue
.defAEC
a function that is used to pass the result ofrun()
when an async task impedes execution from completing. result of
Returns an instance of Task
fn
the function (task) to executeopts
autoRetry
determines if it should continue execution after all deps are ready, if true, it retries by passing the result to the function labeled as 'asynchronousExecutionCatcher' passed toexecute
. If it's not labeled or present, it usesdefAEC
. Default istrue
.defAEC
a function that is used to pass the result ofexecute()
when an async task impedes execution from completing. result of
- Anything after will be registered as an arg of a task set.
Returns an instance of AsyncTask
fn
the function (task) to executeopts
autoRetry
determines if it should continue execution after all deps are ready, if true, it retries by passing the result to the function labeled as 'asynchronousExecutionCatcher' passed toexecute
. If it's not labeled or present, it usesdefAEC
. Default istrue
.defAEC
a function that is used to pass the result ofexecute()
when an async task impedes execution from completing. result of
- Anything after will be registered as an arg of a task set.
Creates and returns a new instance of Task.
fn
the function (task) to executeopts
autoRetry
determines if it should continue execution after all deps are ready, if true, it retries by passing the result to the function labeled as 'asynchronousExecutionCatcher' passed toexecute
. If it's not labeled or present, it usesdefAEC
. Default istrue
.defAEC
a function that is used to pass the result ofexecute()
when an async task impedes execution from completing. result of
- Anything after will be registered as an arg of a task set.
Creates and returns a new instance of AsyncTask
fn
the function (task) to executeopts
autoRetry
determines if it should continue execution after all deps are ready, if true, it retries by passing the result to the function labeled as 'asynchronousExecutionCatcher' passed toexecute
. If it's not labeled or present, it usesdefAEC
. Default istrue
.defAEC
a function that is used to pass the result ofexecute()
when an async task impedes execution from completing. result of
- Anything after will be registered as an arg of a task set.
Runs the sequence. Returns the result of the last task in the sequence.
aEC
must be labeled with the property.asyncExecCatcher
; if passed is used instead of defAEC,- Anything after will be registered as an arg of set passed to the first task in the lineup
Used to represent any function that is to be executed.
Adds a dependency to the task being called from. Essentially, a dep is a function
whose return value will be used as the arg passed to the task. Returns the id
of the task.
fn
any valid functionindex
, 0-based index of where the arg (dep's result) will be place relative toset
set
any 1 of the 5 valid sets
Removes the dep by id of the task from wich it was called. Returns the fn
of the removed dep or signal ID_UNRESOLVED
.
id
, the id of the dep redturned byaddDep()
Moves a dep's placement. Return the new id of the dep or ID_UNRESOLVED
id
, id number refering to the depindex
, the new indexset
, the set to placeindex
Executes the task. Returns the result of the task or EXECUTION_DELAYED
.
aEF
, a function labeled by a propasyncExecCatcher
that is to catch the result of the task ifEXECUTION_DELAYED
is initially returned.- Anything after will be registered as an arg of set passed
Inherits from Task and EventEmitter. Used for tasks that will be called at some point later.
Returns a function to be called by the user when the async task should be
executed. The return function acts the same as Task.prototype.execute()
.
Returns the result of the async task if it was executed or ASYNC_NOT_EXECUTED
Sets are used to give relativity when referring to an index of a dep. They are better understood if you talk about the as, of , e.g. 0 of task 0 of final
There are a total of five sets and they go like this: dep
and task
makeup
internal
; internal
and passed
makeup final.
final
/ \
passed internal
/ \
task dep
TODO: provide a friendly graphic
dep is used as a default when using addDep()
task is used when passing args at the time of creating the task, such as,
mkTask()
, mkAsyncTask()
, tsk.addTask()
, tsk.addAsyncTask()
internal is comprises the above
passed is used when finally executing the task and passing the args at the
last second, execute()
final comrpises all of the above
Signals can be accessed by require("taskrunner").signals
. Signals are can be
thought of placeholders or types that have specific significance. Say, instead
of returning null in a function and surmising that an 'id' wasn't found, we use
signals to specifically know the reason.
TODO: add a friendly graphic depecting a bad ass sequence flow