Example #1
0
        public IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state)
        {
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this.WIGStartInfo, callback, state);

            this.Enqueue(workItem);
            return(workItem.GetWorkItemResult());
        }
Example #2
0
        public IWorkItemResult QueueWorkItem(WorkItemInfo workItemInfo, WorkItemCallback callback)
        {
            this.PreQueueWorkItem();
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this.WIGStartInfo, workItemInfo, callback);

            this.Enqueue(workItem);
            return(workItem.GetWorkItemResult());
        }
Example #3
0
        public IWorkItemResult <TResult> QueueWorkItem <TResult>(XUtils.Threading.Base.Func <TResult> func)
        {
            this.PreQueueWorkItem();
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this.WIGStartInfo, (object state) => func());

            this.Enqueue(workItem);
            return(new WorkItemResultTWrapper <TResult>(workItem.GetWorkItemResult()));
        }
Example #4
0
        public IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state, PostExecuteWorkItemCallback postExecuteWorkItemCallback, CallToPostExecute callToPostExecute, WorkItemPriority workItemPriority)
        {
            this.PreQueueWorkItem();
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this.WIGStartInfo, callback, state, postExecuteWorkItemCallback, callToPostExecute, workItemPriority);

            this.Enqueue(workItem);
            return(workItem.GetWorkItemResult());
        }
Example #5
0
        public IWorkItemResult <TResult> QueueWorkItem <T, TResult>(XUtils.Threading.Base.Func <T, TResult> func, T arg)
        {
            this.PreQueueWorkItem();
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this.WIGStartInfo, (object state) => func(arg), this.WIGStartInfo.FillStateWithArgs ? new object[]
            {
                arg
            } : null);

            this.Enqueue(workItem);
            return(new WorkItemResultTWrapper <TResult>(workItem.GetWorkItemResult()));
        }
Example #6
0
        public IWorkItemResult QueueWorkItem(XUtils.Threading.Base.Action action)
        {
            this.PreQueueWorkItem();
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this.WIGStartInfo, delegate
            {
                action();
                return(null);
            });

            this.Enqueue(workItem);
            return(workItem.GetWorkItemResult());
        }
Example #7
0
        public IWorkItemResult QueueWorkItem <T>(Action <T> action, T arg)
        {
            this.PreQueueWorkItem();
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this.WIGStartInfo, delegate(object state)
            {
                action(arg);
                return(null);
            }, this.WIGStartInfo.FillStateWithArgs ? new object[]
            {
                arg
            } : null);

            this.Enqueue(workItem);
            return(workItem.GetWorkItemResult());
        }
Example #8
0
        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());
        }
Example #9
0
 public static WorkItem CreateWorkItem(IWorkItemsGroup workItemsGroup, WIGStartInfo wigStartInfo, WorkItemCallback callback)
 {
     return(WorkItemFactory.CreateWorkItem(workItemsGroup, wigStartInfo, callback, null));
 }