diff options
Diffstat (limited to 'ThirdParty/SmartThreadPool/WorkItemInfo.cs')
-rw-r--r-- | ThirdParty/SmartThreadPool/WorkItemInfo.cs | 171 |
1 files changed, 69 insertions, 102 deletions
diff --git a/ThirdParty/SmartThreadPool/WorkItemInfo.cs b/ThirdParty/SmartThreadPool/WorkItemInfo.cs index c259339..5fbceb8 100644 --- a/ThirdParty/SmartThreadPool/WorkItemInfo.cs +++ b/ThirdParty/SmartThreadPool/WorkItemInfo.cs | |||
@@ -1,102 +1,69 @@ | |||
1 | // Ami Bar | 1 | namespace Amib.Threading |
2 | // amibar@gmail.com | 2 | { |
3 | 3 | #region WorkItemInfo class | |
4 | namespace Amib.Threading | 4 | |
5 | { | 5 | /// <summary> |
6 | #region WorkItemInfo class | 6 | /// Summary description for WorkItemInfo. |
7 | 7 | /// </summary> | |
8 | /// <summary> | 8 | public class WorkItemInfo |
9 | /// Summary description for WorkItemInfo. | 9 | { |
10 | /// </summary> | 10 | public WorkItemInfo() |
11 | public class WorkItemInfo | 11 | { |
12 | { | 12 | UseCallerCallContext = SmartThreadPool.DefaultUseCallerCallContext; |
13 | /// <summary> | 13 | UseCallerHttpContext = SmartThreadPool.DefaultUseCallerHttpContext; |
14 | /// Use the caller's security context | 14 | DisposeOfStateObjects = SmartThreadPool.DefaultDisposeOfStateObjects; |
15 | /// </summary> | 15 | CallToPostExecute = SmartThreadPool.DefaultCallToPostExecute; |
16 | private bool _useCallerCallContext; | 16 | PostExecuteWorkItemCallback = SmartThreadPool.DefaultPostExecuteWorkItemCallback; |
17 | 17 | WorkItemPriority = SmartThreadPool.DefaultWorkItemPriority; | |
18 | /// <summary> | 18 | } |
19 | /// Use the caller's security context | 19 | |
20 | /// </summary> | 20 | public WorkItemInfo(WorkItemInfo workItemInfo) |
21 | private bool _useCallerHttpContext; | 21 | { |
22 | 22 | UseCallerCallContext = workItemInfo.UseCallerCallContext; | |
23 | /// <summary> | 23 | UseCallerHttpContext = workItemInfo.UseCallerHttpContext; |
24 | /// Dispose of the state object of a work item | 24 | DisposeOfStateObjects = workItemInfo.DisposeOfStateObjects; |
25 | /// </summary> | 25 | CallToPostExecute = workItemInfo.CallToPostExecute; |
26 | private bool _disposeOfStateObjects; | 26 | PostExecuteWorkItemCallback = workItemInfo.PostExecuteWorkItemCallback; |
27 | 27 | WorkItemPriority = workItemInfo.WorkItemPriority; | |
28 | /// <summary> | 28 | Timeout = workItemInfo.Timeout; |
29 | /// The option to run the post execute | 29 | } |
30 | /// </summary> | 30 | |
31 | private CallToPostExecute _callToPostExecute; | 31 | /// <summary> |
32 | 32 | /// Get/Set if to use the caller's security context | |
33 | /// <summary> | 33 | /// </summary> |
34 | /// A post execute callback to call when none is provided in | 34 | public bool UseCallerCallContext { get; set; } |
35 | /// the QueueWorkItem method. | 35 | |
36 | /// </summary> | 36 | /// <summary> |
37 | private PostExecuteWorkItemCallback _postExecuteWorkItemCallback; | 37 | /// Get/Set if to use the caller's HTTP context |
38 | 38 | /// </summary> | |
39 | /// <summary> | 39 | public bool UseCallerHttpContext { get; set; } |
40 | /// The priority of the work item | 40 | |
41 | /// </summary> | 41 | /// <summary> |
42 | private WorkItemPriority _workItemPriority; | 42 | /// Get/Set if to dispose of the state object of a work item |
43 | 43 | /// </summary> | |
44 | public WorkItemInfo() | 44 | public bool DisposeOfStateObjects { get; set; } |
45 | { | 45 | |
46 | _useCallerCallContext = SmartThreadPool.DefaultUseCallerCallContext; | 46 | /// <summary> |
47 | _useCallerHttpContext = SmartThreadPool.DefaultUseCallerHttpContext; | 47 | /// Get/Set the run the post execute options |
48 | _disposeOfStateObjects = SmartThreadPool.DefaultDisposeOfStateObjects; | 48 | /// </summary> |
49 | _callToPostExecute = SmartThreadPool.DefaultCallToPostExecute; | 49 | public CallToPostExecute CallToPostExecute { get; set; } |
50 | _postExecuteWorkItemCallback = SmartThreadPool.DefaultPostExecuteWorkItemCallback; | 50 | |
51 | _workItemPriority = SmartThreadPool.DefaultWorkItemPriority; | 51 | /// <summary> |
52 | } | 52 | /// Get/Set the post execute callback |
53 | 53 | /// </summary> | |
54 | public WorkItemInfo(WorkItemInfo workItemInfo) | 54 | public PostExecuteWorkItemCallback PostExecuteWorkItemCallback { get; set; } |
55 | { | 55 | |
56 | _useCallerCallContext = workItemInfo._useCallerCallContext; | 56 | /// <summary> |
57 | _useCallerHttpContext = workItemInfo._useCallerHttpContext; | 57 | /// Get/Set the work item's priority |
58 | _disposeOfStateObjects = workItemInfo._disposeOfStateObjects; | 58 | /// </summary> |
59 | _callToPostExecute = workItemInfo._callToPostExecute; | 59 | public WorkItemPriority WorkItemPriority { get; set; } |
60 | _postExecuteWorkItemCallback = workItemInfo._postExecuteWorkItemCallback; | 60 | |
61 | _workItemPriority = workItemInfo._workItemPriority; | 61 | /// <summary> |
62 | } | 62 | /// Get/Set the work item's timout in milliseconds. |
63 | 63 | /// This is a passive timout. When the timout expires the work item won't be actively aborted! | |
64 | public bool UseCallerCallContext | 64 | /// </summary> |
65 | { | 65 | public long Timeout { get; set; } |
66 | get { return _useCallerCallContext; } | 66 | } |
67 | set { _useCallerCallContext = value; } | 67 | |
68 | } | 68 | #endregion |
69 | 69 | } | |
70 | public bool UseCallerHttpContext | ||
71 | { | ||
72 | get { return _useCallerHttpContext; } | ||
73 | set { _useCallerHttpContext = value; } | ||
74 | } | ||
75 | |||
76 | public bool DisposeOfStateObjects | ||
77 | { | ||
78 | get { return _disposeOfStateObjects; } | ||
79 | set { _disposeOfStateObjects = value; } | ||
80 | } | ||
81 | |||
82 | public CallToPostExecute CallToPostExecute | ||
83 | { | ||
84 | get { return _callToPostExecute; } | ||
85 | set { _callToPostExecute = value; } | ||
86 | } | ||
87 | |||
88 | public PostExecuteWorkItemCallback PostExecuteWorkItemCallback | ||
89 | { | ||
90 | get { return _postExecuteWorkItemCallback; } | ||
91 | set { _postExecuteWorkItemCallback = value; } | ||
92 | } | ||
93 | |||
94 | public WorkItemPriority WorkItemPriority | ||
95 | { | ||
96 | get { return _workItemPriority; } | ||
97 | set { _workItemPriority = value; } | ||
98 | } | ||
99 | } | ||
100 | |||
101 | #endregion | ||
102 | } | ||