1
+ <cfscript >
2
+ asyncManager = controller .getAsyncManager ();
3
+ executors = asyncManager .getExecutors ();
4
+ executorKeys = executors .keyArray ();
5
+ arraySort ( executorKeys , " textnocase" );
6
+ </cfscript >
7
+ <cfoutput >
8
+ <!--- Title --->
9
+ <div class =" cbd-titles" onClick =" cbdToggle( 'cbdAsync' )" >
10
+
11
+ <svg xmlns =" http://www.w3.org/2000/svg" class =" h-6 w-6" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
12
+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
13
+ </svg >
14
+ ColdBox Async Manager
15
+ </div >
16
+
17
+ <!--- Panel --->
18
+ <div
19
+ class =" cbd-contentView<cfif args.debuggerConfig.async.expanded> cbd-show<cfelse> cbd-hide</cfif>"
20
+ id =" cbdAsync"
21
+ >
22
+
23
+ <!--- Info Bar --->
24
+ <div class =" mt10 mb10" >
25
+ <div >
26
+ <strong >Total Executors:</strong >
27
+ <div class =" cbd-badge-light" >
28
+ #executors .count () #
29
+ </div >
30
+ </div >
31
+ </div >
32
+
33
+ <!--- Executor Reports --->
34
+ <table border =" 0" align =" center" cellpadding =" 0" cellspacing =" 1" class =" cbd-tables" >
35
+ <tr >
36
+ <th align =" left" >Name</th >
37
+ <th width =" 200" align =" left" >Type</th >
38
+ <th width =" 75" align =" center" >Pool Size</th >
39
+ <th width =" 75" align =" center" >Core Size</th >
40
+ <th width =" 75" align =" center" >Active Tasks</th >
41
+ <th width =" 75" align =" center" >Scheduled Tasks</th >
42
+ <th width =" 75" align =" center" >Completed Tasks</th >
43
+ <th width =" 50" align =" center" >Actions</th >
44
+ </tr >
45
+
46
+ <cfloop array =" #executorKeys #" index =" executorName" >
47
+ <cfset this Executor = executors [ executorName ] >
48
+ <cfset stats = this Executor .getStats () >
49
+ <tr >
50
+ <td >
51
+ #executorName #
52
+ </td >
53
+ <td >
54
+ #listLast ( this Executor .getNative ().getClass ().getName (), " ." ) #
55
+ </td >
56
+ <td align =" center" >
57
+ #stats .poolSize #
58
+ </td >
59
+ <td align =" center" >
60
+ #stats .corePoolSize #
61
+ </td >
62
+ <td align =" center" >
63
+ #stats .activeCount #
64
+ </td >
65
+ <td align =" center" >
66
+ #stats .taskCount #
67
+ </td >
68
+ <td align =" center" >
69
+ #numberFormat ( stats .completedTaskCount ) #
70
+ </td >
71
+ <td align =" center" >
72
+ <button
73
+ title =" View Tasks"
74
+ onclick =" cbdToggle( 'cbdExecutorReport-#executorName #' )"
75
+ >
76
+ <svg xmlns =" http://www.w3.org/2000/svg" class =" h-6 w-6" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
77
+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M8 16l2.879-2.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242zM21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
78
+ </svg >
79
+ </button >
80
+ </td >
81
+ </tr >
82
+
83
+ <!--- Task Report --->
84
+ <tr class =" cbd-hide cbd-bg-gray" id =" cbdExecutorReport-#executorName #" >
85
+ <td colspan =" 8" class =" p20" >
86
+ <cfset queue = this Executor .getQueue ().toArray () >
87
+ <cfif arrayLen ( queue ) >
88
+ <table border =" 0" align =" center" cellpadding =" 0" cellspacing =" 1" class =" cbd-tables" >
89
+ <tr >
90
+ <th align =" left" >Task Id</th >
91
+ <th align =" left" width =" 75" >Periodic</th >
92
+ <th align =" left" width =" 75" >Delay (sec)</th >
93
+ <th align =" left" width =" 75" >Done</th >
94
+ <th align =" left" width =" 75" >Cancelled</th >
95
+ </tr >
96
+
97
+ <cfloop array =" #queue #" index =" thisTask" >
98
+ <cfset isScheduledFuture = findNoCase ( " ScheduledFuture" , this Task .getClass ().getName () ) >
99
+ <tr >
100
+ <td >
101
+ #this Task .hashCode () #
102
+ </td >
103
+
104
+ <!--- Periodic? --->
105
+ <td >
106
+ <cfif isScheduledFuture >
107
+ #yesNoFormat ( this Task .isPeriodic () ) #
108
+ <cfelse >
109
+ <em >n/a</em >
110
+ </cfif >
111
+ </td >
112
+ <!--- Get Delay --->
113
+ <td >
114
+ <cfif isScheduledFuture >
115
+ #numberFormat ( this Task .getDelay ( this Executor .$timeUnit .get ( " seconds" ) ) ) #
116
+ <cfelse >
117
+ <em >n/a</em >
118
+ </cfif >
119
+ </td >
120
+ <!--- Done --->
121
+ <td >
122
+ #yesNoFormat ( this Task .isDone () ) #
123
+ </td >
124
+ <!--- Cancelled --->
125
+ <td >
126
+ #yesNoFormat ( this Task .isCancelled () ) #
127
+ </td >
128
+ </tr >
129
+ </cfloop >
130
+
131
+ </table >
132
+ <cfelse >
133
+ <em class =" cbd-text-red" >
134
+ No running tasks
135
+ </em >
136
+ </cfif >
137
+ </td >
138
+ </tr >
139
+ </cfloop >
140
+
141
+ </table >
142
+
143
+ </div >
144
+ </cfoutput >
0 commit comments