Newer
Older
A toolkit to simplify the creation of ASAP::O workers.
> This project is in an early stage of development and should be used with caution
## Installation
AsapoWorker requires
Download the latest release and extract it. Optionally run
```
$ cd AsapoWorker
$ pip install .
```
## Usage example
* Create a AsapoWorker application
```
from AsapoWorker import Configurable, Config, Worker, Application, AsapoSender
from MyAnalyis import analyse
@Configurable
class MyWorker(Worker):
myparameter = Config(
"A configurable parameter", type=float)
def process(self, data):
data, metadata = analyse(data, self.myparameter)
self.send(data, metadata)
app = Application(worker_class=MyWorker, producer_class=AsapoSender)
app.run()
```
* Start the worker
```
python path/to/worker.py \
--receiver.stream in_stream_name \
--sender.stream out_stream_name \
--worker.myparameter 1.23
```
## Contribution
Please feel free to open issues or pull requests.