WorkflowApplication.BeginUnload 方法

定義

使用 IAsyncResult 非同步設計模式,以非同步方式保存和處置工作流程執行個體。Persists and disposes a workflow instance asynchronously using the IAsyncResult asynchronous design pattern.

多載

BeginUnload(TimeSpan, AsyncCallback, Object)

使用指定的逾時間隔、回呼方法及使用者提供的狀態,以非同步方式保存和處置工作流程執行個體。Persists and disposes a workflow instance asynchronously using the specified time-out interval, callback method, and user-provided state.

BeginUnload(AsyncCallback, Object)

使用指定的回呼方法及使用者提供的狀態,以非同步方式保存和處置工作流程執行個體。Persists and disposes a workflow instance asynchronously using the specified callback method and user-provided state.

備註

如需詳細資訊, 請參閱非同步程式設計總覽For more information, see Asynchronous Programming Overview.

如果先前已從持續性載入工作流程執行個體,則會使用用來載入工作流程的相同 InstanceStore 做為保存。If the workflow instance was previously loaded from persistence, then the same InstanceStore used to load the workflow is used for persistence. 如果工作流程已建立但尚未保存,則必須在呼叫這個方法之前設定 InstanceStore,否則呼叫這個方法時會擲回 InvalidOperationExceptionIf the workflow was created and has not yet been persisted, then an InstanceStore must be configured before calling this method or else an InvalidOperationException is thrown when this method is called.

BeginUnload(TimeSpan, AsyncCallback, Object)

使用指定的逾時間隔、回呼方法及使用者提供的狀態,以非同步方式保存和處置工作流程執行個體。Persists and disposes a workflow instance asynchronously using the specified time-out interval, callback method, and user-provided state.

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

參數

timeout
TimeSpan

BeginTerminate 作業必須在作業取消並擲回 TimeoutException 前完成的間隔。The interval in which the BeginTerminate operation must complete before the operation is canceled and a TimeoutException is thrown.

callback
AsyncCallback

BeginUnload 作業已完成時,所要呼叫的方法。The method to be called when the BeginUnload operation has completed.

state
Object

選擇性的應用程式特定物件,其中包含非同步作業的相關資訊。An optional application-specific object that contains information about the asynchronous operation.

傳回

非同步 BeginUnload 作業的參考。A reference to the asynchronous BeginUnload operation.

備註

若要判斷 BeginUnload 作業是否成功,請呼叫EndUnloadTo determine whether the BeginUnload operation was successful, call EndUnload. EndUnload 可以從 callback 參數中參考的方法之內或之外呼叫。EndUnload can be called from inside or outside of the method reference in the callback parameter. 如果在 EndUnload 作業完成前呼叫 BeginUnload,它會封鎖直到 BeginUnload 作業完成為止。If EndUnload is called before the BeginUnload operation completes, it blocks until the BeginUnload operation completes. 如果 BeginUnload 作業沒有在指定的逾時間隔內完成,則會從 TimeoutException 擲回 EndUnloadIf the BeginUnload operation does not complete within the specified time-out interval a TimeoutException is thrown from EndUnload.

如果先前已從持續性載入工作流程執行個體,則會使用用來載入工作流程的相同 InstanceStore 做為保存。If the workflow instance was previously loaded from persistence, then the same InstanceStore used to load the workflow is used for persistence. 如果工作流程已建立但尚未保存,則必須在呼叫這個方法之前設定 InstanceStore,否則呼叫這個方法時會擲回 InvalidOperationExceptionIf the workflow was created and has not yet been persisted, then an InstanceStore must be configured before calling this method or else an InvalidOperationException is thrown when this method is called.

這個方法會使用 IAsyncResult 非同步設計模式來非同步保存和卸載工作流程執行個體。This method persists and unloads a workflow instance asynchronously using the IAsyncResult asynchronous design pattern. 如需詳細資訊, 請參閱非同步程式設計總覽For more information, see Asynchronous Programming Overview.

BeginUnload(AsyncCallback, Object)

使用指定的回呼方法及使用者提供的狀態,以非同步方式保存和處置工作流程執行個體。Persists and disposes a workflow instance asynchronously using the specified callback method and user-provided state.

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

參數

callback
AsyncCallback

BeginUnload 作業已完成時,所要呼叫的方法。The method to be called when the BeginUnload operation has completed.

state
Object

選擇性的應用程式特定物件,其中包含非同步作業的相關資訊。An optional application-specific object that contains information about the asynchronous operation.

傳回

非同步 BeginUnload 作業的參考。A reference to the asynchronous BeginUnload operation.

備註

若要判斷 BeginUnload 作業是否成功,請呼叫EndUnloadTo determine whether the BeginUnload operation was successful, call EndUnload. EndUnload 可以從 callback 參數中參考的方法之內或之外呼叫。EndUnload can be called from inside or outside of the method reference in the callback parameter. 如果在 EndUnload 作業完成前呼叫 BeginUnload,它會封鎖直到 BeginUnload 作業完成為止。If EndUnload is called before the BeginUnload operation completes, it blocks until the BeginUnload operation completes. 根據預設,BeginUnload 作業必須在 30 秒內完成,否則會從 TimeoutException 擲回 EndUnloadBy default, the BeginUnload operation must complete in 30 seconds or a TimeoutException is thrown from EndUnload.

如果先前已從持續性載入工作流程執行個體,則會使用用來載入工作流程的相同 InstanceStore 做為保存。If the workflow instance was previously loaded from persistence, then the same InstanceStore used to load the workflow is used for persistence. 如果工作流程已建立但尚未保存,則必須在呼叫這個方法之前設定 InstanceStore,否則呼叫這個方法時會擲回 InvalidOperationExceptionIf the workflow was created and has not yet been persisted, then an InstanceStore must be configured before calling this method or else an InvalidOperationException is thrown when this method is called.

這個方法會使用 IAsyncResult 非同步設計模式來非同步保存和處置工作流程執行個體。This method persists and disposes a workflow instance asynchronously using the IAsyncResult asynchronous design pattern. 如需詳細資訊, 請參閱非同步程式設計總覽For more information, see Asynchronous Programming Overview.

適用於