chevere / workflow
Async workflow procedures for PHP
Requires
- amphp/parallel: ^1.4
- chevere/chevere: ^2.0
Requires (Dev)
- chevere/var-dump: ^0.7.1
- chevere/xr: ^0.7.0
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.5
- symplify/easy-coding-standard: ^11.1
README
🔔 Subscribe to the newsletter to don't miss any update regarding Chevere.
Quick start
Install with Composer.
composer install chevere/workflow
Create a Workflow by passing named jobs.
async
for asynchronous non-blocking jobssync
for synchronous blocking jobsvariable
for defining a variablereference
to define a reference to a previous job
use function Chevere\Workflow\workflow; use function Chevere\Workflow\sync; use function Chevere\Workflow\async; use function Chevere\Workflow\variable; $workflow = workflow( thumb: async( new ImageResize(), file: variable('file'), fit: 'thumbnail', ), poster: async( new ImageResize(), file: variable('file'), fit: 'poster', ), store: sync( new StoreFiles(), reference('thumb', 'out'), reference('poster', 'out'), ) );
Run your Workflow:
use function Chevere\Workflow\run; $variables = [ 'file' => '/path/to/file' ]; $run = run($workflow, $variables);
Variable $run
will be assigned to an object implementing RunInterface
, which you can query for obtaining data from the Workflow runtime.
Documentation
Documentation is available at chevere.org.
License
Copyright 2022 Rodolfo Berrios A.
This software is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.