2017 © Pedro PelĂĄez
 

library job-bundle

Performing asynchronous jobs with Symfony2

image

lilweb/job-bundle

Performing asynchronous jobs with Symfony2

  • Monday, December 16, 2013
  • by geoffrey-brier
  • Repository
  • 1 Watchers
  • 0 Stars
  • 541 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 5 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Installation

1. Configuration du composer.json

Ajouter dans le fichier composer.json :, (*1)

"require": {
    "lilweb/job-bundle": "dev-master"
}

Il est aussi possible de le faire en ligne de commande:, (*2)

$> composer require lilweb/job-bundle

2. Activer le bundle

Dans app/AppKernel.php:, (*3)


<config>
    <tasks>
        <task name="import:csv" service-id="lilweb:import_csv">
            <max-parallel-execution value="2" />
        </task>
        <task name="calcul:besoin" service-id="lilweb:calcul_besoin">
        </task>
        <task name="export:csv" service-id="lilweb:export_csv">
        </task>
        <task name="export:ftp" service-id="lilweb:export_ftp">
        </task>
    </tasks>
    <jobs>
        <job name="besoin:all" schedulable="true">
            <task name="import:csv" />
            <task name="calcul:besoin" />
            <task name="export:csv" />
            <task name="export:ftp" />
        </job>
    </jobs>
</config>

4.1 Définition des taches

Chaque tache est définie dans le noeud <tasks>., (*4)

## BALISE <task>
Attributs obligatoires:
    - service-id: Nom du service a exécuté lors du lancement de l'ordonnanceur
    - name:       Nom de la tache (également repris dans la configuration des jobs)
Balises optionnelles:
    - <max-parallel-execution>: Configure le maximum d'exécution en parallÚle de la tache

## BALISE <max-parallel-execution>
Attributs obligatoires:
    - value: Un nombre (-1 pour illimité)

4.2 Définition des jobs

Chaque job est défini dans le noeud <jobs>., (*5)

## BALISE <job>
Attributs obligatoires:
    - name:  Nom du job
Attributs optionnels:
    - schedulable: valeur par défaut false, passer a true si le scheduler doit traiter le job.
Balises obligatoires:
    - <task>: Au moins une tache doit ĂȘtre dĂ©finie pour un job. Cette tache est en quelque sorte
              une sorte de pointer vers une des taches définie plus haut, de ce fait les attributs
              'name' doivent correspondrent.

4.3 Définition des services

Chaque tache (import csv, export ftp ...) possĂšde un comportement qui lui est propre. C'est pourquoi celui-ci se doit d'ĂȘtre dĂ©fini dans une service hĂ©ritant de AbstractTaskService (lilweb.abstract_task), afin de rationnaliser l'exĂ©cution des taches., (*6)

CÎté config:, (*7)

lilweb.import_csv:
    class: %lilweb.import_csv.class%
    parent: lilweb.abstract_task

CÎté PHP:, (*8)


use Lilweb\JobBundle\Entity\TaskInfo; use Lilweb\JobBundle\Services\AbstractTaskService; class ImportCsv extends AbstractTaskService { /** * {@inheritdoc} */ public function execute(TaskInfo $info) { // Traitement de la tache // Logging de ce qui se passe } }

The Versions

16/12 2013

dev-master

9999999-dev http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

16/12 2013

0.3.4

0.3.4.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

22/08 2013

0.3.3

0.3.3.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

09/08 2013

0.3.2

0.3.2.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

09/08 2013

0.3.1

0.3.1.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

09/08 2013

0.3.0

0.3.0.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

09/07 2013

dev-develop

dev-develop http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

17/06 2013

0.2.1

0.2.1.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

11/06 2013

0.2.0

0.2.0.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

29/05 2013

dev-rabbit-mq

dev-rabbit-mq http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

28/05 2013

0.1.2

0.1.2.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

15/05 2013

0.1.1

0.1.1.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous

26/04 2013

0.1.0

0.1.0.0 http://github.com/lilweb/JobBundle

Performing asynchronous jobs with Symfony2

  Sources   Download

MIT

The Requires

 

by Geoffrey BRIER

jobs asynchronous