PHPackages                             ibrahimgunduz34/shepherd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ibrahimgunduz34/shepherd

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ibrahimgunduz34/shepherd
========================

Process pooling component for Symfony Process component

4161PHP

Since Mar 2Pushed 7y ago3 watchersCompare

[ Source](https://github.com/ibrahimgunduz34/ShepherdProcessPoolBundle)[ Packagist](https://packagist.org/packages/ibrahimgunduz34/shepherd)[ RSS](/packages/ibrahimgunduz34-shepherd/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Shepherd Process Pool
=====================

[](#shepherd-process-pool)

[![Build Status](https://camo.githubusercontent.com/df2ef07f0918bbc41666b7a6c8ee3fd5d84a2fe01a233503a2cf8717122aa54d/68747470733a2f2f7472617669732d63692e6f72672f6962726168696d67756e64757a33342f536865706865726450726f63657373506f6f6c42756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ibrahimgunduz34/ShepherdProcessPoolBundle)

Shepherd is an easy way to run the processes in parallel. Also, you can control how many processes you can run in parallel or decide to stop all jobs in the queue if anyone is failed.

How To Install
--------------

[](#how-to-install)

Call the following command to add the package to your project as a composer dependency.

```
composer require ibrahimgunduz34/shepherd

```

How To Configure
----------------

[](#how-to-configure)

You can simply define your process pools in `pools` section separately. Also, you can define some default options in `defaults` section and override them in each pool definition if it's needed.

```
shepherd:
    defaults:
        max_processes: 4
        fail_on_error: true
    pools:
        foo:
            max_processes: 2
            fail_on_error: false
        bar:
            max_processes: 8
```

How To Use
----------

[](#how-to-use)

Basically, Shepherd creates services for each pool definition. So you can simply inject the pools anywhere. It creates services with`shepherd.pool.` naming convention.

```
App\Service\MyService:
    class: App\Service\MyService
    arguments:
        - '@shepherd.pool.foo'
```

You can keep adding new processes until starting the pool processing.

```
