/usr/share/doc/python-kiwi/api/kiwi.tasklet.Tasklet.html is in python-kiwi 1.9.22-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html>
<head>
<title>kiwi.tasklet.Tasklet : API documentation</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link type="text/css" rel="stylesheet" href="bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="apidocs.css" />
</head>
<body>
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">
Kiwi API Documentation
</a>
</div>
</div>
</nav>
<div id="showPrivate">
<button class="btn btn-link" onclick="togglePrivate()">Toggle Private API</button>
</div>
<div class="container">
<div class="page-header">
<h1 class="class"><code>kiwi.tasklet.Tasklet(<span title="object">object</span>)</code> <small>class documentation</small></h1>
<span id="partOf">
Part of <code><a href="kiwi.html" data-type="Package" class="code">kiwi</a>.<a href="kiwi.tasklet.html" data-type="Module" class="code">tasklet</a></code>
<a href="classIndex.html#kiwi.tasklet.Tasklet">(View In Hierarchy)</a>
</span>
</div>
<div class="extrasDocstring">
</div>
<div class="moduleDocstring">
<div><p>An object that launches and manages a tasklet.</p><table class="fieldTable"></table></div>
</div>
<div id="splitTables">
<table class="children sortable" id="id31">
<tr class="instancevariable">
<td>Instance Variable</td>
<td><a href="kiwi.tasklet.Tasklet.html#state" data-type="Instance Variable" class="code">state</a></td>
<td>current execution state of the tasklet, one of the STATE_* contants.</td>
</tr><tr class="instancevariable">
<td>Instance Variable</td>
<td><a href="kiwi.tasklet.Tasklet.html#return_value" data-type="Instance Variable" class="code">return_value</a></td>
<td>the value returned by the task function, or None.</td>
</tr><tr class="classvariable">
<td>Class Variable</td>
<td><a href="kiwi.tasklet.Tasklet.html#STATE_RUNNING" data-type="Class Variable" class="code">STATE_RUNNING</a></td>
<td>the tasklet function is currently executing code</td>
</tr><tr class="classvariable">
<td>Class Variable</td>
<td><a href="kiwi.tasklet.Tasklet.html#STATE_SUSPENDED" data-type="Class Variable" class="code">STATE_SUSPENDED</a></td>
<td>the tasklet function is currently waiting for an event</td>
</tr><tr class="classvariable">
<td>Class Variable</td>
<td><a href="kiwi.tasklet.Tasklet.html#STATE_MSGSEND" data-type="Class Variable" class="code">STATE_MSGSEND</a></td>
<td>the tasklet function is currently sending a message</td>
</tr><tr class="classvariable">
<td>Class Variable</td>
<td><a href="kiwi.tasklet.Tasklet.html#STATE_ZOMBIE" data-type="Class Variable" class="code">STATE_ZOMBIE</a></td>
<td>the tasklet function has ended</td>
</tr><tr class="method">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#__init__" data-type="Method" class="code">__init__</a></td>
<td><span>Launch a generator tasklet.</span></td>
</tr><tr class="method">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#start" data-type="Method" class="code">start</a></td>
<td><span>Starts the execution of the task, for use with tasklets created with
start=False</span></td>
</tr><tr class="method">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#get_message_actions" data-type="Method" class="code">get_message_actions</a></td>
<td><span>Dictionary mapping message names to actions ('accept' or 'discard' or
'defer'). Should normally not be accessed directly by the programmer.</span></td>
</tr><tr class="method">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#run" data-type="Method" class="code">run</a></td>
<td><span>Method that executes the task.</span></td>
</tr><tr class="method">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#wait_condition_fired" data-type="Method" class="code">wait_condition_fired</a></td>
<td><span>Method that should be called when a wait condition fires</span></td>
</tr><tr class="method">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#add_join_callback" data-type="Method" class="code">add_join_callback</a></td>
<td><span>Add a callable to be invoked when the tasklet finishes. Return a
connection handle that can be used in remove_join_callback()</span></td>
</tr><tr class="method">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#remove_join_callback" data-type="Method" class="code">remove_join_callback</a></td>
<td><span>Remove a join callback previously added with <a href="kiwi.tasklet.Tasklet.html#add_join_callback"><code>add_join_callback</code></a></span></td>
</tr><tr class="method">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#send_message" data-type="Method" class="code">send_message</a></td>
<td><span>Send a message to be received by the tasklet as an event.</span></td>
</tr><tr class="method private">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#_invoke" data-type="Method" class="code">_invoke</a></td>
<td><span class="undocumented">Undocumented</span></td>
</tr><tr class="method private">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#_next_round" data-type="Method" class="code">_next_round</a></td>
<td><span class="undocumented">Undocumented</span></td>
</tr><tr class="method private">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#_dispatch_message" data-type="Method" class="code">_dispatch_message</a></td>
<td><span>get next message that a tasklet wants to receive; discard messages that
should be discarded</span></td>
</tr><tr class="method private">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#_update_wait_conditions" data-type="Method" class="code">_update_wait_conditions</a></td>
<td><span>disarm wait conditions removed and arm new wait conditions</span></td>
</tr><tr class="method private">
<td>Method</td>
<td><a href="kiwi.tasklet.Tasklet.html#_join" data-type="Method" class="code">_join</a></td>
<td><span class="undocumented">Undocumented</span></td>
</tr>
</table>
</div>
<div id="childList">
<div class="baseinstancevariable">
<a name="kiwi.tasklet.Tasklet.state">
</a>
<a name="state">
</a>
<div class="functionHeader">
state =
</div>
<div class="functionBody">
current execution state of the tasklet, one of the STATE_* contants.
</div>
</div><div class="baseinstancevariable">
<a name="kiwi.tasklet.Tasklet.return_value">
</a>
<a name="return_value">
</a>
<div class="functionHeader">
return_value =
</div>
<div class="functionBody">
the value returned by the task function, or None.
</div>
</div><div class="baseclassvariable">
<a name="kiwi.tasklet.Tasklet.STATE_RUNNING">
</a>
<a name="STATE_RUNNING">
</a>
<div class="functionHeader">
STATE_RUNNING =
</div>
<div class="functionBody">
the tasklet function is currently executing code
</div>
</div><div class="baseclassvariable">
<a name="kiwi.tasklet.Tasklet.STATE_SUSPENDED">
</a>
<a name="STATE_SUSPENDED">
</a>
<div class="functionHeader">
STATE_SUSPENDED =
</div>
<div class="functionBody">
the tasklet function is currently waiting for an event
</div>
</div><div class="baseclassvariable">
<a name="kiwi.tasklet.Tasklet.STATE_MSGSEND">
</a>
<a name="STATE_MSGSEND">
</a>
<div class="functionHeader">
STATE_MSGSEND =
</div>
<div class="functionBody">
the tasklet function is currently sending a message
</div>
</div><div class="baseclassvariable">
<a name="kiwi.tasklet.Tasklet.STATE_ZOMBIE">
</a>
<a name="STATE_ZOMBIE">
</a>
<div class="functionHeader">
STATE_ZOMBIE =
</div>
<div class="functionBody">
the tasklet function has ended
</div>
</div><div class="basemethod">
<a name="kiwi.tasklet.Tasklet.__init__">
</a>
<a name="__init__">
</a>
<div class="functionHeader">
def
__init__(self, gen=None, start=True):
</div>
<div class="docstring functionBody">
<div><p>Launch a generator tasklet.</p><table class="fieldTable"><tr class="fieldStart"><td class="fieldName">Parameters</td><td class="fieldArg">gen</td><td>a generator object that implements the tasklet main body</td></tr><tr><td></td><td class="fieldArg">start</td><td>whether to automatically start running the tasklet in the constructor
<p>If `gen` is omitted or None, <a href="kiwi.tasklet.Tasklet.html#run"><code>run</code></a> should be
overridden in a subclass.</p></td></tr></table></div>
</div>
</div><div class="basemethod">
<a name="kiwi.tasklet.Tasklet.start">
</a>
<a name="start">
</a>
<div class="functionHeader">
def
start(self):
</div>
<div class="docstring functionBody">
<div><p>Starts the execution of the task, for use with tasklets created with
start=False</p><table class="fieldTable"></table></div>
</div>
</div><div class="basemethod">
<a name="kiwi.tasklet.Tasklet.get_message_actions">
</a>
<a name="get_message_actions">
</a>
<div class="functionHeader">
def
get_message_actions(self):
</div>
<div class="docstring functionBody">
<div><p>Dictionary mapping message names to actions ('accept' or 'discard' or
'defer'). Should normally not be accessed directly by the programmer.</p><table class="fieldTable"></table></div>
</div>
</div><div class="basemethod">
<a name="kiwi.tasklet.Tasklet.run">
</a>
<a name="run">
</a>
<div class="functionHeader">
def
run(self):
</div>
<div class="docstring functionBody">
<div><p>Method that executes the task.</p>
<p>Should be overridden in a subclass if no generator is passed into the
constructor.</p><table class="fieldTable"><tr class="fieldStart"><td class="fieldName">Note</td><td colspan="2">do NOT call this method directly; it is meant to be called by the tasklet
framework.</td></tr></table></div>
</div>
</div><div class="basemethod private">
<a name="kiwi.tasklet.Tasklet._invoke">
</a>
<a name="_invoke">
</a>
<div class="functionHeader">
def
_invoke(self):
</div>
<div class="docstring functionBody">
<div class="undocumented">Undocumented</div>
</div>
</div><div class="basemethod private">
<a name="kiwi.tasklet.Tasklet._next_round">
</a>
<a name="_next_round">
</a>
<div class="functionHeader">
def
_next_round(self):
</div>
<div class="docstring functionBody">
<div class="undocumented">Undocumented</div>
</div>
</div><div class="basemethod private">
<a name="kiwi.tasklet.Tasklet._dispatch_message">
</a>
<a name="_dispatch_message">
</a>
<div class="functionHeader">
def
_dispatch_message(self):
</div>
<div class="docstring functionBody">
<div><p>get next message that a tasklet wants to receive; discard messages that
should be discarded</p><table class="fieldTable"></table></div>
</div>
</div><div class="basemethod private">
<a name="kiwi.tasklet.Tasklet._update_wait_conditions">
</a>
<a name="_update_wait_conditions">
</a>
<div class="functionHeader">
def
_update_wait_conditions(self, old_wait_list):
</div>
<div class="docstring functionBody">
<div><p>disarm wait conditions removed and arm new wait conditions</p><table class="fieldTable"></table></div>
</div>
</div><div class="basemethod">
<a name="kiwi.tasklet.Tasklet.wait_condition_fired">
</a>
<a name="wait_condition_fired">
</a>
<div class="functionHeader">
def
wait_condition_fired(self, triggered_cond):
</div>
<div class="docstring functionBody">
<div><p>Method that should be called when a wait condition fires</p><table class="fieldTable"></table></div>
</div>
</div><div class="basemethod">
<a name="kiwi.tasklet.Tasklet.add_join_callback">
</a>
<a name="add_join_callback">
</a>
<div class="functionHeader">
def
add_join_callback(self, callback, *extra_args):
</div>
<div class="docstring functionBody">
<div><p>Add a callable to be invoked when the tasklet finishes. Return a
connection handle that can be used in remove_join_callback()</p>
<p>The callback will be called like this:</p>
<pre class="literalblock">
callback(tasklet, retval, *extra_args)
</pre>
<p>where tasklet is the tasklet that finished, and retval its return value
(or None).</p>
<p>When a join callback is invoked, it is automatically removed, so calling
<a href="kiwi.tasklet.Tasklet.html#remove_join_callback"><code>remove_join_callback</code></a>
afterwards produces a KeyError exception.</p><table class="fieldTable"></table></div>
</div>
</div><div class="basemethod">
<a name="kiwi.tasklet.Tasklet.remove_join_callback">
</a>
<a name="remove_join_callback">
</a>
<div class="functionHeader">
def
remove_join_callback(self, handle):
</div>
<div class="docstring functionBody">
<div><p>Remove a join callback previously added with <a href="kiwi.tasklet.Tasklet.html#add_join_callback"><code>add_join_callback</code></a></p><table class="fieldTable"></table></div>
</div>
</div><div class="basemethod private">
<a name="kiwi.tasklet.Tasklet._join">
</a>
<a name="_join">
</a>
<div class="functionHeader">
def
_join(self, retval):
</div>
<div class="docstring functionBody">
<div class="undocumented">Undocumented</div>
</div>
</div><div class="basemethod">
<a name="kiwi.tasklet.Tasklet.send_message">
</a>
<a name="send_message">
</a>
<div class="functionHeader">
def
send_message(self, message):
</div>
<div class="docstring functionBody">
<div><p>Send a message to be received by the tasklet as an event.</p><table class="fieldTable"><tr class="fieldStart"><td class="fieldName">Note</td><td colspan="2">Don't call this from another tasklet, only from the main loop! To send a
message from another tasklet, yield a <a href="kiwi.tasklet.Message.html"><code>Message</code></a> with a correctly
set 'dest' parameter.</td></tr></table></div>
</div>
</div>
</div>
<address>
<a href="index.html">API Documentation</a> for Kiwi, generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a> at 2015-12-15 11:23:22.
</address>
</div>
<script type="text/javascript" src="pydoctor.js"></script>
</body>
</html>
|