Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

flexVDI's Task system is asynchronous. That is, when you create a new task, Manager will inmediately 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 recommond to follow this protocol.

  1. Create the new task
  2. Inspect the TaskResult object, inmediately 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).
  3. Sleep during 1 second
  4. Using the task identifier obtained in 2, execute a task query
  5. Inspect the returned object, and obtain the value of the field state
  6. If state is pending, return to 3
  7. If state is completed, obtain the value of fields result and result_msg
  8. Inspect result and result_msg and act accordingly

 

  • No labels