本文整理汇总了C#中PostExecuteWorkItemCallback类的典型用法代码示例。如果您正苦于以下问题:C# PostExecuteWorkItemCallback类的具体用法?C# PostExecuteWorkItemCallback怎么用?C# PostExecuteWorkItemCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PostExecuteWorkItemCallback类属于命名空间,在下文中一共展示了PostExecuteWorkItemCallback类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WIGStartInfo
public WIGStartInfo()
{
_useCallerCallContext = SmartThreadPool.DefaultUseCallerCallContext;
_useCallerHttpContext = SmartThreadPool.DefaultUseCallerHttpContext;
_disposeOfStateObjects = SmartThreadPool.DefaultDisposeOfStateObjects;
_callToPostExecute = SmartThreadPool.DefaultCallToPostExecute;
_postExecuteWorkItemCallback = SmartThreadPool.DefaultPostExecuteWorkItemCallback;
_startSuspended = SmartThreadPool.DefaultStartSuspended;
}
示例2: WIGStartInfo
public WIGStartInfo(WIGStartInfo wigStartInfo)
{
_useCallerCallContext = wigStartInfo.UseCallerCallContext;
_useCallerHttpContext = wigStartInfo.UseCallerHttpContext;
_disposeOfStateObjects = wigStartInfo.DisposeOfStateObjects;
_callToPostExecute = wigStartInfo.CallToPostExecute;
_postExecuteWorkItemCallback = wigStartInfo.PostExecuteWorkItemCallback;
_workItemPriority = wigStartInfo.WorkItemPriority;
_startSuspended = wigStartInfo.StartSuspended;
_fillStateWithArgs = wigStartInfo.FillStateWithArgs;
}
示例3: WIGStartInfo
// Token: 0x06001837 RID: 6199
// RVA: 0x00074E5C File Offset: 0x0007305C
public WIGStartInfo(WIGStartInfo wigstartInfo_0)
{
this._useCallerCallContext = wigstartInfo_0.UseCallerCallContext;
this._useCallerHttpContext = wigstartInfo_0.UseCallerHttpContext;
this._disposeOfStateObjects = wigstartInfo_0.DisposeOfStateObjects;
this._callToPostExecute = wigstartInfo_0.CallToPostExecute;
this._postExecuteWorkItemCallback = wigstartInfo_0.PostExecuteWorkItemCallback;
this._workItemPriority = wigstartInfo_0.WorkItemPriority;
this._startSuspended = wigstartInfo_0.StartSuspended;
this._fillStateWithArgs = wigstartInfo_0.FillStateWithArgs;
}
示例4: ChainedDelegatesPostExecute
public void ChainedDelegatesPostExecute()
{
SmartThreadPool smartThreadPool = new SmartThreadPool();
IWorkItemsGroup workItemsGroup = smartThreadPool.CreateWorkItemsGroup(int.MaxValue);
PostExecuteWorkItemCallback postExecuteWorkItemCallback =
new PostExecuteWorkItemCallback(DoPostExecute);
postExecuteWorkItemCallback +=
new PostExecuteWorkItemCallback(DoPostExecute);
workItemsGroup.QueueWorkItem(
new WorkItemCallback(DoWork),
null,
postExecuteWorkItemCallback);
workItemsGroup.WaitForIdle();
smartThreadPool.Shutdown();
}
示例5: CreateWorkItem
/// <summary>
/// Create a new work item
/// </summary>
/// <param name = "wigStartInfo">Work item group start information</param>
/// <param name = "callback">A callback to execute</param>
/// <param name = "state">
/// The context object of the work item. Used for passing arguments to the work item.
/// </param>
/// <param name = "postExecuteWorkItemCallback">
/// A delegate to call after the callback completion
/// </param>
/// <param name = "callToPostExecute">Indicates on which cases to call to the post execute callback</param>
/// <param name = "workItemPriority">The work item priority</param>
/// <returns>Returns a work item</returns>
public static WorkItem CreateWorkItem(
IWorkItemsGroup workItemsGroup,
WIGStartInfo wigStartInfo,
WorkItemCallback callback,
object state,
PostExecuteWorkItemCallback postExecuteWorkItemCallback,
CallToPostExecute callToPostExecute,
WorkItemPriority workItemPriority)
{
ValidateCallback(callback);
ValidateCallback(postExecuteWorkItemCallback);
WorkItemInfo workItemInfo = new WorkItemInfo
{
UseCallerCallContext = wigStartInfo.UseCallerCallContext,
UseCallerHttpContext = wigStartInfo.UseCallerHttpContext,
PostExecuteWorkItemCallback = postExecuteWorkItemCallback,
CallToPostExecute = callToPostExecute,
WorkItemPriority = workItemPriority,
DisposeOfStateObjects = wigStartInfo.DisposeOfStateObjects
};
WorkItem workItem = new WorkItem(
workItemsGroup,
workItemInfo,
callback,
state);
return workItem;
}
示例6: CreateWorkItem
/// <summary>
/// Create a new work item
/// </summary>
/// <param name="workItemsGroup"></param>
/// <param name="wigStartInfo">Work item group start information</param>
/// <param name="callback">A callback to execute</param>
/// <param name="state">
/// The context object of the work item. Used for passing arguments to the work item.
/// </param>
/// <param name="postExecuteWorkItemCallback">
/// A delegate to call after the callback completion
/// </param>
/// <returns>Returns a work item</returns>
public static WorkItem CreateWorkItem(
IWorkItemsGroup workItemsGroup,
WIGStartInfo wigStartInfo,
WorkItemCallback callback,
object state,
PostExecuteWorkItemCallback postExecuteWorkItemCallback)
{
ValidateCallback(callback);
ValidateCallback(postExecuteWorkItemCallback);
WorkItemInfo workItemInfo = new WorkItemInfo();
workItemInfo.UseCallerCallContext = wigStartInfo.UseCallerCallContext;
workItemInfo.UseCallerHttpContext = wigStartInfo.UseCallerHttpContext;
workItemInfo.PostExecuteWorkItemCallback = postExecuteWorkItemCallback;
workItemInfo.CallToPostExecute = wigStartInfo.CallToPostExecute;
workItemInfo.DisposeOfStateObjects = wigStartInfo.DisposeOfStateObjects;
WorkItem workItem = new WorkItem(
workItemsGroup,
workItemInfo,
callback,
state);
return workItem;
}
示例7: QueueWorkItem
/// <summary>
/// Queue a work item
/// </summary>
/// <param name="callback">A callback to execute</param>
/// <param name="state">
/// The context object of the work item. Used for passing arguments to the work item.
/// </param>
/// <param name="postExecuteWorkItemCallback">
/// A delegate to call after the callback completion
/// </param>
/// <param name="callToPostExecute">Indicates on which cases to call to the post execute callback</param>
/// <param name="workItemPriority">The work item priority</param>
/// <returns>Returns a work item result</returns>
public IWorkItemResult QueueWorkItem(
WorkItemCallback callback,
object state,
PostExecuteWorkItemCallback postExecuteWorkItemCallback,
CallToPostExecute callToPostExecute,
WorkItemPriority workItemPriority)
{
ValidateNotDisposed();
ValidateCallback(callback);
WorkItem workItem = WorkItemFactory.CreateWorkItem(this, _stpStartInfo, callback, state, postExecuteWorkItemCallback, callToPostExecute, workItemPriority);
Enqueue(workItem);
return workItem.GetWorkItemResult();
}
示例8: QueueWorkItem
/// <summary>
/// Queue a work item
/// </summary>
/// <param name="callback">A callback to execute</param>
/// <param name="state">
/// The context object of the work item. Used for passing arguments to the work item.
/// </param>
/// <param name="postExecuteWorkItemCallback">
/// A delegate to call after the callback completion
/// </param>
/// <param name="callToPostExecute">Indicates on which cases to call to the post execute callback</param>
/// <param name="workItemPriority">The work item priority</param>
/// <returns>Returns a work item result</returns>
public IWorkItemResult QueueWorkItem(
WorkItemCallback callback,
object state,
PostExecuteWorkItemCallback postExecuteWorkItemCallback,
CallToPostExecute callToPostExecute,
WorkItemPriority workItemPriority)
{
WorkItem workItem = WorkItemFactory.CreateWorkItem(this, _workItemsGroupStartInfo, callback, state,
postExecuteWorkItemCallback, callToPostExecute,
workItemPriority);
EnqueueToSTPNextWorkItem(workItem);
return workItem.GetWorkItemResult();
}
示例9: IrrWorkItemMaintainer
private void IrrWorkItemMaintainer()
{
while (true)
{
List<IrrWorkItem> items = null;
lock (irrWorkItems)
{
if (irrWorkItems.Count > 0)
{
items = new List<IrrWorkItem>(irrWorkItems);
}
}
if (items != null)
{
foreach (IrrWorkItem item in items)
{
if (item.retry <= asset_fetch_retry)
{
WorkItemCallback callback = new WorkItemCallback(item.callback);
PostExecuteWorkItemCallback posthandler = new PostExecuteWorkItemCallback(PostIrrWorkItemHandler);
requestingThreadPool.QueueWorkItem(callback, item, posthandler);
item.retry++;
}
lock (irrWorkItems)
{
irrWorkItems.Remove(item);
}
}
}
System.Threading.Thread.Sleep(1000);
}
}
示例10: WorkItemInfo
public WorkItemInfo(WorkItemInfo workItemInfo)
{
_useCallerCallContext = workItemInfo._useCallerCallContext;
_useCallerHttpContext = workItemInfo._useCallerHttpContext;
_disposeOfStateObjects = workItemInfo._disposeOfStateObjects;
_callToPostExecute = workItemInfo._callToPostExecute;
_postExecuteWorkItemCallback = workItemInfo._postExecuteWorkItemCallback;
_workItemPriority = workItemInfo._workItemPriority;
}