public IWorkItemResult QueueWorkItem <T1, T2>(XUtils.Threading.Base.Action <T1, T2> action, T1 arg1, T2 arg2)
        {
            this.PreQueueWorkItem();
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this.WIGStartInfo, delegate(object state)
            {
                action(arg1, arg2);
                return(null);
            }, this.WIGStartInfo.FillStateWithArgs ? new object[]
            {
                arg1,
                arg2
            } : null);

            this.Enqueue(workItem);
            return(workItem.GetWorkItemResult());
        }
Exemple #2
0
 public static WorkItem CreateWorkItem(IWorkItemsGroup workItemsGroup, WIGStartInfo wigStartInfo, WorkItemCallback callback)
 {
     return(WorkItemFactory.CreateWorkItem(workItemsGroup, wigStartInfo, callback, null));
 }
Exemple #3
0
 public static WorkItem CreateWorkItem(IWorkItemsGroup workItemsGroup, WIGStartInfo wigStartInfo, WorkItemInfo workItemInfo, WorkItemCallback callback, object state)
 {
     WorkItemFactory.ValidateCallback(callback);
     WorkItemFactory.ValidateCallback(workItemInfo.PostExecuteWorkItemCallback);
     return(new WorkItem(workItemsGroup, new WorkItemInfo(workItemInfo), callback, state));
 }