-
Notifications
You must be signed in to change notification settings - Fork 7
/
Task--Chained.html
112 lines (84 loc) · 4.05 KB
/
Task--Chained.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Task::Chained - Easy chaining of different tasks. : OpenKore source code documentation</title>
<link rel="stylesheet" type="text/css" href="openkore.css">
<link rel="stylesheet" type="text/css" href="highlight.css">
<!-- Fix broken PNG transparency for IE/Win5-6+ -->
<!--[if gte IE 5.5000]>
<script type="text/javascript" src="pngfix.js"></script>
<![endif]-->
</head>
<body>
<div id="title">OpenKore source code documentation</div>
<div id="navigation">
<ul>
<li><a href="http://www.openkore.com/">Main website</a></li>
<li><a href="index.html">Table of contents</a></li>
<li><b>Task::Chained</b></li>
</ul>
</div>
<div id="main">
<h1>Task::Chained - Easy chaining of different tasks.</h1>
This task allows you to easily combine different tasks into a single,
more complex task. Given a list of tasks, Task::Chain will execute all
of those tasks, in the same order as they are given. Task::Chain will
stop when all tasks are finished, or if a task failed.
<p>
Task::Chained will also use the same mutex as the currently active subtask.
<p>
<h3>Example</h3>
The following example creates a Task::Chained task which first stands, then
waits 3 seconds, and then sits again.
<pre class="example">
<span class="hl kwc">my</span> <span class="hl kwb">$task</span> <span class="hl sym">=</span> new Task<span class="hl sym">::</span><span class="hl kwd">Chained</span><span class="hl sym">(</span>
tasks <span class="hl sym">=> [</span>
new Task<span class="hl sym">::</span><span class="hl kwd">SitStand</span><span class="hl sym">(</span>mode <span class="hl sym">=></span> <span class="hl str">'stand'</span><span class="hl sym">),</span>
new Task<span class="hl sym">::</span><span class="hl kwd">Wait</span><span class="hl sym">(</span>seconds <span class="hl sym">=></span> <span class="hl num">3</span><span class="hl sym">),</span>
new Task<span class="hl sym">::</span><span class="hl kwd">SitStand</span><span class="hl sym">(</span>mode <span class="hl sym">=></span> <span class="hl str">'sit'</span><span class="hl sym">)</span>
<span class="hl sym">]</span>
<span class="hl sym">);</span>
</pre>
<p><table class="functionIndex">
<tr><th colspan="3">Constructor</th></tr><tr onclick="location.href='#Task::Chained->new';">
<td class="return-type"></td>
<td class="func"><a href="#Task::Chained->new">Task::Chained->new</a></td>
<td class="decl">(...)</td>
</tr>
</table>
<p><hr class="details_sep">
<h2>Details</h2>
<div class="details">
<p>
<div class="function"><a name="Task::Chained->new"></a>
<h3>Task::Chained->new</h3>
<dl>
<dt class="decl">
<span class="return-type"> </span><strong>Task::Chained->new</strong>(...)
</dt>
<dd>
<div class="desc">Create a new Task::Chained object.
<p>
The following arguments are allowed:
<ul>
<li>All options allowed for <a href="Task.html#Task->new"><code>Task->new()</code></a>, except 'mutexes'.</li>
<li>tasks (required) - An array of tasks to be run.
</li>
</ul></div>
</dd>
</dl>
</div>
</div>
<p><hr><p>
<div id="footer">
<ul>
<li><a href="http://validator.w3.org/check?uri=referer" title="Valid HTML 4.01!"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" height="31" width="88"></a></li>
<li><a href="http://www.mozilla.com/" title="Get Firefox - Take Back the Web"><img width="104" height="32" src="http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png" alt="Get Firefox - Take Back the Web"></a></li>
<li><a href="http://www.mozilla.com/" title="If you were looking at this page in any browser but Microsoft Internet Explorer, it would look and run better and faster"><img width="45" height="45" src="http://linuxart.com/img/noIE-small.png" alt="If you were looking at this page in any browser but Microsoft Internet Explorer, it would look and run better and faster"></a></li>
</ul>
Last modified: Fri Nov 16 10:05:11 2012
</div>
</div>
</body>
</html>