A pipeline system for efficient execution.
Project description
Pyturbo Package
Author: Lijun Yu
Email: lijun@lj-y.com
A pipeline system for efficient execution.
Installation
pip install py-turbo
Introduction
Pyturbo
utilizes multiple level of abstract to efficiently execute parallel tasks.
- Worker: a process.
- Stage: a group of peer workers processing the same type of tasks.
- Task: a data unit transferred between stages. At each stage, a task is processed by one worker and will result in one or multiple downstream tasks.
- Pipeline: a set of sequential stages.
- Job: a data unit for a pipeline, typically a wrapped task for the first stage.
- Result: output of a job processed by one pipeline, typically a set of output tasks from the last stage.
- System: a set of peer pipelines processing the same type of jobs.
Get Started
from pyturbo import ReorderStage, Stage, System
class Stage1(Stage): # Define a stage
def __init__(self, resources):
... # Optional: set resources and number of workers
def process(self, task):
... # Process function for each worker process. Returns one or a series of downstream tasks.
... # Repeat for Stage2, Stage3
class Stage4(ReorderStage): # Define a reorder stage, typically for the final stage
def get_sequence_id(self, task):
... # Return the order of each task. Start from 0.
def process(self, task):
...
class MySystem(System):
def get_stages(self, resources):
... # Define the stages in a pipeline with given resources.
def get_results(self, results_gen):
... # Define how to extract final results from output tasks.
def main():
system = MySystem(num_pipeline) # Set debug=True to run in a single process
system.start() # Build and start system
system.add_job(...) # Submit one job
finished_job = system.result_queue.get() # Wait for result
system.end() # End system
Demo
See demo.py for an example implementation.
Version History
See version.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py-turbo-0.2.tar.gz
(8.1 kB
view details)
Built Distribution
py_turbo-0.2-py3-none-any.whl
(22.6 kB
view details)
File details
Details for the file py-turbo-0.2.tar.gz
.
File metadata
- Download URL: py-turbo-0.2.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8eb8ef02150b48c3ea0f7e6b95d1b15cd2c3fc0ab6654cef4de148e6867c1fe1
|
|
MD5 |
6b54272951e1623b8c440f476b79294b
|
|
BLAKE2b-256 |
711ae936c70a856bf4a540290f6b14f0d2db81fd5116c7288ac47ea9d8915547
|
File details
Details for the file py_turbo-0.2-py3-none-any.whl
.
File metadata
- Download URL: py_turbo-0.2-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
bd1b600704c3d7e39cfc3230a4ebc2dde7f2fa188cdd0d8a7160b251759c06fb
|
|
MD5 |
57bc34c2c644a25462bc11e38d708c9b
|
|
BLAKE2b-256 |
97d9bef716d48000440c96642c0b2482f57d58061649b978bc634b23e82acc17
|