/
Waiting for a task to complete
Waiting for a task to complete
flexVDI's Task system is asynchronous. That is, when you create a new task, Manager will immediately answer, without waiting for the new task to end.
Sometimes, it could be useful, or even necessary for an external script or program, to wait for the end of a certain task. For those cases, we recommend to follow this protocol.
- Create the new task
- Inspect the TaskResult object, immediately returned by Manager, and if status is OK (that is, the task was successfully created), store the contents of the field message (this is the task identifier).
- Sleep during 1 second
- Using the task identifier obtained in 2, execute a task query
- Inspect the returned object, and obtain the value of the field state
- If state is pending, return to 3
- If state is completed, obtain the value of fields result and result_msg
- Inspect result and result_msg and act accordingly
, multiple selections available,
Related content
Waiting for a task to complete
Waiting for a task to complete
More like this
Waiting for a task to complete
Waiting for a task to complete
More like this
Notifications
Notifications
More like this
The main window
The main window
More like this
Configure Manager's watchdog
Configure Manager's watchdog
More like this
Problems with flexVDI Manager
Problems with flexVDI Manager
More like this