WorkflowApplication.BeginCancel Method

Definition

Cancels a workflow asynchronously using the IAsyncResult asynchronous design pattern.

Overloads

BeginCancel(AsyncCallback, Object)

Cancels a workflow instance asynchronously using the specified AsyncCallback and user-provided state.

BeginCancel(TimeSpan, AsyncCallback, Object)

Cancels a workflow instance asynchronously using the specified time-out interval, AsyncCallback, and user-provided state.

Remarks

For more information, see Asynchronous Programming Overview.

BeginCancel(AsyncCallback, Object)

Cancels a workflow instance asynchronously using the specified AsyncCallback and user-provided state.

public:
 IAsyncResult ^ BeginCancel(AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginCancel (AsyncCallback callback, object state);
member this.BeginCancel : AsyncCallback * obj -> IAsyncResult
Public Function BeginCancel (callback As AsyncCallback, state As Object) As IAsyncResult

Parameters

callback
AsyncCallback

The method to be called when the cancel operation has completed.

state
Object

An optional application-specific object that contains information about the asynchronous operation.

Returns

A reference to the asynchronous cancel operation.

Remarks

To determine whether the cancel operation was successful, call EndCancel. EndCancel can be called from inside or outside of the callback method. If EndCancel is called before the cancel operation completes, it blocks until the cancel operation completes. By default, the cancel operation must complete in 30 seconds or a TimeoutException is thrown from EndCancel.

This method cancels a workflow asynchronously using the IAsyncResult asynchronous design pattern. For more information, see Asynchronous Programming Overview.

Applies to

BeginCancel(TimeSpan, AsyncCallback, Object)

Cancels a workflow instance asynchronously using the specified time-out interval, AsyncCallback, and user-provided state.

public:
 IAsyncResult ^ BeginCancel(TimeSpan timeout, AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginCancel (TimeSpan timeout, AsyncCallback callback, object state);
member this.BeginCancel : TimeSpan * AsyncCallback * obj -> IAsyncResult
Public Function BeginCancel (timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters

timeout
TimeSpan

The interval in which the cancel operation must complete before the operation is canceled and a TimeoutException is thrown.

callback
AsyncCallback

The method to be called when the cancel operation has completed.

state
Object

An optional application-specific object that contains information about the asynchronous operation.

Returns

A reference to the asynchronous cancel operation.

Remarks

To determine whether the cancel operation was successful, call EndCancel. EndCancel can be called from inside or outside of the method specified in the callback parameter. If EndCancel is called before the cancel operation completes, it blocks until the cancel operation completes. If the cancel operation does not complete in the interval specified by the timeOut parameter, a TimeoutException is thrown from EndCancel.

This method cancels a workflow asynchronously using the IAsyncResult asynchronous design pattern. For more information, see Asynchronous Programming Overview.

Applies to