TaskSuspend Method  
 

Suspend execution of an asynchronous task.

Syntax

object.TaskSuspend ( TaskId )

Parameters

TaskId
An optional integer value that specifies the unique identifier associated with a background task.

Return Value

A value of zero is returned if the operation was successful, otherwise a non-zero error code is returned which indicates the cause of the failure.

Remarks

The TaskSuspend method will suspend execution of the background worker thread associated with the task. If the TaskId parameter is omitted, the method will suspend the last background task that was started.

Once the task has been suspended, it will no longer be scheduled for execution, however the client session will remain active and the task may be resumed using the TaskResume method. Note that if a task is suspended for a long period of time, the background operation may fail because it has exceeded the timeout period imposed by the server.

See Also

TaskId Property, TaskResume Method, TaskWait Method