inexorgame-obsolete / deprecated-cube-engine-inexor

UNMAINTAINED: Please have a look at the vulkan-renderer
https://inexor.org
zlib License
12 stars 1 forks source link

Task progress manager #538

Open aschaeffer opened 7 years ago

aschaeffer commented 7 years ago

Problem to solve

There are several tasks which takes time:

We would like to visualize the progress of these tasks using progress bars:

Solution

Inexor Tree

Lvl 1 & 2 Lvl 3 Datatype Description Example
/tasks/instances/{id} Node The unique id of the task instance
/displayName string The display name to use in the UI or command line e.g. Downloading release 0.9.0
/taskGroup string The name of a task group provided by the caller e.g. downloadRelease
/unit string The unit of measurement default: %
/min float The minimum value default: 0.0
/max float The maximum value default: 100.0
/current float The current progress e.g. 30.5
/currentAlternative string An alternative string representing the current progress e.g. 158.5 MB
/startedDate string ISO8601 Date, when the task was started
/completedDate string ISO8601 Date, when the task was completed
/instance int64 Optional: the instance id 31417

TaskManager & API

Description Return Value Method Signature Trigger Example
Creates a new task with progress treeNode createTask(displayName, taskName, initial = 0, min = 0, max = 100, unit = '%', instance = 0)
Updates the cureent value of a task --- updateTask(id / treeNode, current, currentAlternative = '')
Get a specific task by task id treeNode getTaskById(id)
Get all tasks filtered by taskGroup treeNode[] getTasksByTaskGroup(taskGroup) e.g. downloadRelease
Get all tasks filtered by instance id treeNode[] getTasksByInstanceId(instanceId) e.g. 31417
Get all started tasks treeNode[] getStartedTasks() min == current < max
Get all ongoing tasks treeNode[] getActiveTasks() min < current < max
Get all completed tasks treeNode[] getCompletedTasks() min < current == max
Get all tasks treeNode[] getAllTasks()
Removes a specific task by id --- removeTask(id / treeNode) Task failed / aborted
Remove all tasks by task group --- removeTasksByTaskGroup(taskGroup) Destructor of a calling service
Remove all tasks by instance id --- removeTasksByInstanceId(instanceId) Connector on instance goes down
Remove all completed tasks --- removeCompletedTasks() Scheduler
Remove all tasks --- removeAllTasks() Shutdown Flex

User Interfaces

For the HTML5/JS user interfaces we could implement a reusable progress bar component which gets automatically updated using websockets.

User Interface Description
ui-flex Progress view lists all tasks and their progress (like the view Progress in Eclipse). Also allows to filter tasks by taskGroup, by instanceId, by state (started, ongoing, completed)
ui-hud Show map loading progress
command line / shell Show progress bars