Metadata-Version: 2.1
Name: pypushflow
Version: 0.3.0b5
Summary: A task scheduler for cyclic and acyclic graphs
Home-page: https://gitlab.esrf.fr/workflow/pypushflow
Author: ESRF
Author-email: svensson@esrf.fr
License: MIT
Project-URL: Bug Tracker, https://gitlab.esrf.fr/workflow/pypushflow/-/issues
Platform: UNKNOWN
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Provides-Extra: mx
Provides-Extra: test
License-File: LICENSE.md

# pypushflow

A task scheduler for cyclic and acyclic graphs

## Install

```bash
python -m pip install pypushflow[mx]
```

Use the `mx` option for installation at MX beamlines.

## Run tests

```bash
python -m pip install pypushflow[test]
pytest
```


## Getting started

```python
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):
    """
    Workflow containing one start actor,
    one python actor and one stop actor.
    """

    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.test.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 1")
inData = {"name": "Jerry"}
outData = testMyWorkflow.run(inData, timeout=15, shared_pool=True)
assert outData["reply"] == "Hello Jerry!"
```

