newTask

Create new a BeeCluster task.

handler = session.newTask(
func,
*argv,
TaskName = None,
SameDrone=False,
NonInterruptible = False,
callback_handler = None,
error_handler = None,
timeout = None
)

Parameters

NameDescription
funcThe task function.
*argvArguments of the task function.
TaskNameThe name of the function. If this field is None, the name of the task will be the name of the task function.
SameDroneThe SameDrone binding flag.
NonInterruptibleThe NonInterruptible binding flag.
callback_handlerWhen the task is completed, BeeCluster runtime calls the callback_handler. There is one passed-in parameter which is the result of the task.
error_handlerWhen an error occurrs, BeeCluster runtime calls the error_handler with one passed-in parameter which is the error type.
timeoutA number indicate the timeout. The unit is second. When timed out, BeeCluster runtime calls the error_handler.

Return

Return an Task object as the task handler.

Remark

This function call is non-blocking. Blocking happens when the execution result of the task is retrieved from the action handler or calling wait() on the task handler explicitly.

  • handler.val Retrieve the execution result of a task from its handler (blocking)
  • handler.wait() Wait until the task is completed (blocking)