Metadata-Version: 2.4
Name: pypushflow
Version: 2.0.0rc1
Summary: A task scheduler for cyclic and acyclic graphs
Author-email: ESRF <dau-pydev@esrf.fr>
License: # MIT License
        
        **Copyright (c) 2021 European Synchrotron Radiation Facility**
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the "Software"), to deal in
        the Software without restriction, including without limitation the rights to
        use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
        the Software, and to permit persons to whom the Software is furnished to do so,
        subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
        FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
        COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
        IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
        CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://gitlab.esrf.fr/workflow/pypushflow/
Project-URL: Documentation, https://pypushflow.readthedocs.io/
Project-URL: Repository, https://gitlab.esrf.fr/workflow/pypushflow/
Project-URL: Issues, https://gitlab.esrf.fr/workflow/pypushflow/issues
Project-URL: Changelog, https://gitlab.esrf.fr/workflow/pypushflow/-/blob/main/CHANGELOG.md
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md
Provides-Extra: mx
Requires-Dist: pymongo>=3; extra == "mx"
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-subtests>=0.4; extra == "test"
Requires-Dist: psutil>=5.8; extra == "test"
Requires-Dist: mongita>=1; extra == "test"
Requires-Dist: mongomock; extra == "test"
Requires-Dist: numpy; extra == "test"
Provides-Extra: dev
Requires-Dist: pypushflow[test]; extra == "dev"
Requires-Dist: black>=25; extra == "dev"
Requires-Dist: flake8>=4; extra == "dev"
Requires-Dist: isort; extra == "dev"
Provides-Extra: doc
Requires-Dist: pypushflow[test]; extra == "doc"
Requires-Dist: sphinx>=4.5; extra == "doc"
Requires-Dist: sphinx-autodoc-typehints>=1.16; extra == "doc"
Requires-Dist: pydata-sphinx-theme; extra == "doc"
Requires-Dist: sphinx-copybutton; extra == "doc"
Dynamic: license-file

# pypushflow

A task scheduler for cyclic and acyclic graphs

## Install

```bash
pip install pypushflow[mx]
```

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

## Run tests

```bash
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):
    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/
