Skip to main content

A task scheduler for cyclic and acyclic graphs

Project description

pypushflow

A task scheduler for cyclic and acyclic graphs

Install

python3 -m pip install pypushflow[mx]

Use the mx option for installation at MX beamlines.

Run tests

python3 -m pip install pypushflow[test]
pytest

Getting started

import logging
from pypushflow.Workflow import Workflow
from pypushflow.StopActor import StopActor
from pypushflow.StartActor import StartActor
from pypushflow.PythonActor import PythonActor
from pypushflow.ThreadCounter import ThreadCounter


class MyWorkflow(Workflow):
    def __init__(self, name):
        super().__init__(name, level=logging.DEBUG)
        ctr = ThreadCounter(parent=self)
        self.startActor = StartActor(parent=self, thread_counter=ctr)
        self.pythonActor = PythonActor(
            parent=self,
            script="pypushflow.tests.tasks.pythonActorTest.py",
            name="Python Actor Test",
            thread_counter=ctr,
        )
        self.stopActor = StopActor(parent=self, thread_counter=ctr)
        self.startActor.connect(self.pythonActor)
        self.pythonActor.connect(self.stopActor)


testMyWorkflow = MyWorkflow("Test workflow")
inData = {"name": "World"}
outData = testMyWorkflow.run(inData, timeout=15, pool_type="process")
assert outData["reply"] == "Hello World!"

Documentation

https://pypushflow.readthedocs.io/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypushflow-0.4.0rc1.tar.gz (25.4 kB view details)

Uploaded Source

File details

Details for the file pypushflow-0.4.0rc1.tar.gz.

File metadata

  • Download URL: pypushflow-0.4.0rc1.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for pypushflow-0.4.0rc1.tar.gz
Algorithm Hash digest
SHA256 d7526242ecac160813e5729b9c1737381fd69ecb2d417aebbb011c6920cc9f70
MD5 0c1ecab9438bb77ab4b53f24e1982da2
BLAKE2b-256 94b12a000054a41fe5be14e78b48bc6a9100bca4c17ce3b8ff6681a879a2b4a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page