TaskManager()
Owns and manages one or more tasks.
Constructor
new TaskManager()
Methods
staticglobal() → TaskManager
Returns a singleton instance of TaskManager
.
Returns:
- Type:
- TaskManager
add(task) → TaskManager
Registers a task for this manager.
Parameters:
Name | Type | Description |
---|---|---|
task |
Task | The task to add |
Returns:
this object
- Type:
- TaskManager
clear() → TaskManager
Removes all the tasks from this manager.
Returns:
this object
- Type:
- TaskManager
get(taskName) → Tasknull
Returns a task specified by name
Parameters:
Name | Type | Description |
---|---|---|
taskName |
string | Name of the task to get |
Returns:
the task, or null
if it wasn't found
- Type:
- Task | null
has(task) → boolean
Returns whether this manager owns the specified task.
Parameters:
Name | Type | Description |
---|---|---|
task |
Task | string | A task or task name |
Returns:
- Type:
- boolean
newTask(name, fnopt, depsopt) → Task
Creates a new task and registers it for this manager.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | Task name |
|
fn |
function |
<optional> |
Task job |
deps |
Array.<Task> |
<optional> |
Task dependencies |
Returns:
the created task
- Type:
- Task
remove(taskName) → Task
Deregisters a task from this manager.
Parameters:
Name | Type | Description |
---|---|---|
taskName |
string | Name of the task to remove |
Returns:
the task that is removed
- Type:
- Task