KDE 4.9 PyKDE API Reference

- KDE's Python API

# AbstractWorkerThread Class Reference

`from PyKDE4.marble import *`

Inherits: QThread → QObject
Namespace: Marble

## Detailed Description

The AbstractWorkerThread is a class written for small tasks that have to run multiple times on different data asynchronously. You should be able to use this class for many different tasks, but you'll have to think about Multi-Threading additionally. The AbstractWorkerThread runs the function work() as long as workAvailable() returns true. If there is no work available for a longer time, the thread will switch itself off. As a result you have to call ensureRunning() every time you want something to be worked on. You'll probably want to call this in your addSchedule() function.

## Methods
| __init__ (self, QObject parent=0)
| ensureRunning (self)
| run (self)
| work (self)
bool | workAvailable (self)

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent=0
| ) |  |  |

ensureRunning | ( |  | self ) |

run | ( |  | self ) |

work | ( |  | self ) |

Abstract method:
  This method is abstract and can be overridden but not called directly.

bool workAvailable | ( |  | self ) |

Abstract method:
  This method is abstract and can be overridden but not called directly.