new LoadingProcess()
- Source:
- Copyright:
- 2022 Ferran Recio
- 2022 Ferran Recio
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
The process wrapper class.
This module is used to update a process in the process monitor.
Classes
Members
data
Return the process extra data.
id
Return the process internal id
name
Return the process name
Methods
finish()
Mark the process as finished.
getData() → {Object}
Returns the current rpocess data.
Returns:
the process data
- Type
- Object
onError(callback)
Define a error process callback function.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | the callback function |
onFinish(callback)
Define a finished process callback function.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | the callback function |
onRemove(callback)
Define a removed from monitor process callback function.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | the callback function |
remove()
Remove the process from the monitor.
setError(error)
Set the process error string.
Note: set the error message will mark the process as finished.
Parameters:
Name | Type | Description |
---|---|---|
error |
String | the string message |
setExtraData(extraData)
Stores extra information to the process.
This method is used to add information like the course, the user or any other needed information.
Parameters:
Name | Type | Description |
---|---|---|
extraData |
Object | any extra process information to store |
setName(name)
Rename the process
Parameters:
Name | Type | Description |
---|---|---|
name |
String | the new process name |
setPercentage(percentage)
Set the process percentage.
Parameters:
Name | Type | Description |
---|---|---|
percentage |
Number |