PHPackages                             abc/job-worker-bundle - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. abc/job-worker-bundle

ActiveSymfony-bundle[Queues &amp; Workers](/categories/queues)

abc/job-worker-bundle
=====================

A Symfony to process jobs from AbcJobServerBundle

0.4.1(5y ago)11.9k1MITPHPPHP ^7.2

Since Feb 4Pushed 5y ago3 watchersCompare

[ Source](https://github.com/aboutcoders/job-worker-bundle)[ Packagist](https://packagist.org/packages/abc/job-worker-bundle)[ Docs](http://aboutcoders.com)[ RSS](/packages/abc-job-worker-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (7)Versions (8)Used By (0)

AbcJobWorkerBundle
==================

[](#abcjobworkerbundle)

[![Build Status](https://camo.githubusercontent.com/4f04acb5d5d80d632e36ed470cead493756fc7af1b461dcfd93f776e7a42d9b7/68747470733a2f2f7472617669732d63692e6f72672f61626f7574636f646572732f6a6f622d776f726b65722d62756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/aboutcoders/job-worker-bundle)

A symfony bundle to process jobs managed by AbcJobServerBundle using [php-enqueue](https://github.com/php-enqueue/enqueue-dev) as transport layer.

**Note: This project is still in experimental!**

Demo
----

[](#demo)

You can find a demo [here](https://gitlab.com/hasc/abc-job-demo/).

Installation
------------

[](#installation)

```
composer require abc/job-worker-bundle
```

Configuration Reference
-----------------------

[](#configuration-reference)

```
abc_job_worker:
    server_baseUrl: # Required (e.g. http://domain.tld/api/
    default_queue: default
    default_replyTo: reply
```

Getting Started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

1. A Symfony application with AbcJobServerBundle installed
2. Enqueue transport is configured matching the configuration of AbcJobServerBundle

### Create a job processor

[](#create-a-job-processor)

A job processor must implement the interface `ProcessorInterface`.

```
interface ProcessorInterface
{
    public function process(?string $input, Context $context);
}
```

### Register a job processor

[](#register-a-job-processor)

A job processor must be registered using the tag `abc.job.processor`. You must define the tag attribute `jobName` with it which defines the name of the job that must be processed with this processor.

```
App\Job\SayHelloProcessor:
    tags:
        - { name: 'abc.job.processor', jobName: 'say_hello'}
```

### Configure job routes

[](#configure-job-routes)

A route must be configured for every job. A route consist of three parameters: `name` specifies the the name of the job, `queue` specifies the name of the queue the job is sent to, `replyTo` specifies the name of the queue where the reply of a job is sent to.

Routes are configured by a class that implements the interface `RouteProviderInterface`.

```
