Installation¶
Automatic installation:
pip install comb
comb is listed in PyPI and
can be installed with pip
or easy_install
.
it includes demo applications.
Manual installation: Download the latest source from Github.
git clone https://github.com/kbonez/comb.git
cd comb
python setup.py build
sudo python setup.py install
The comb source code is hosted on GitHub.
Prerequisites: comb was only test on Python 2.7. It may be runs on all Python versions.
How to use¶
To use comb, you should create a python module file. we named slot.
A legal slot must be named ‘Slot’ in your module file and it must be at least contain four method:
initialize
initial resource, e.g: database handle
__enter__
get next data to do,you can fetch one or more data.
slot
user custom code
__exit__
when slot finished, call this method
Start¶
Execute a comb is very simple. just execute:
comb --root SLOT_ROOT_PATH slot-package.slot-module
if you set SLOTPATH environment, you can use:
comb slot-package.slot-module
Quick View. call:
comb comb.demo.list
this will execute the Deal List Demo
Note¶
- You’d better make comb process number equals your cpu core number.
- We strongly recommend you use comb with supervisor