PHPackages                             bcremer/swagjobqueue - 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. bcremer/swagjobqueue

ActiveShopware-core-plugin[Queues &amp; Workers](/categories/queues)

bcremer/swagjobqueue
====================

381PHP

Since May 19Pushed 11y ago1 watchersCompare

[ Source](https://github.com/bcremer/SwagJobQueue)[ Packagist](https://packagist.org/packages/bcremer/swagjobqueue)[ RSS](/packages/bcremer-swagjobqueue/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

SwagJobQueue
============

[](#swagjobqueue)

A job queue integration for shopware
------------------------------------

[](#a-job-queue-integration-for-shopware)

This project provides a shopware plugin that abstracts asynchronous processing via job queues like [beastalk](http://kr.github.io/beanstalkd/).

- Jobs contain the name and the workload of the process to be done.
- The Queue delegates jobs to the workers
- Worker does the processing using the workload from the jobs.

Currently two types of queues are implemented. A InMemoryQueue for testing puposes and a Beanstalk queue.

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

[](#installation)

Clone this repo into the `Core` namespace in your `Local` plugin directory:

```
$ cd /path/to/your/shopware/installation
$ git clone https://github.com/bcremer/SwagJobQueue.git engine/Shopware/Plugins/Local/Core/SwagJobQueue
```

Install dependencies via composer:

```
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
```

Install Plugin in the shopware plugin manager or via the shopware console:

```
$ ./bin/console sw:plugin:refresh
$ ./bin/console sw:plugin:install SwagJobQueue --activate
```

Run worker loop
---------------

[](#run-worker-loop)

The worker loop itself is implemented as a shopware command

```
$ ./bin/console swagjobqueue:run:worker
```

For production you should start and monitor the worker process using a proper pocess control system like [Supervisor](http://supervisord.org/).

Provide own Workers and Jobs
----------------------------

[](#provide-own-workers-and-jobs)

### Define a job

[](#define-a-job)

A job expects a `$name` and an `$args` array containing scalar values.

`\ShopwarePlugins\SwagJobQueue\JobQueue\Job::__construct($name, $args = array())`

```
$job = new \ShopwarePlugins\SwagJobQueue\JobQueue\Job(
    'example_job_name',
    array(
        'foo' => 'bar',
        'baz' => true
    )
);
```

### Put job in queue

[](#put-job-in-queue)

The queue can be obtained via the key `SwagJobQueue_Queue` from the di-container. The interface defines the method `addJob($job)` that can be used to put a job into the queue.

`\ShopwarePlugins\SwagJobQueue\JobQueue\Queue\Queue::addJob($job)`.

```
/** @var $queue \ShopwarePlugins\SwagJobQueue\JobQueue\Queue */
$queue = $this->container->get('SwagJobQueue_Queue');
$queue->addJob($job);
```

### Worker

[](#worker)

The worker has to implement the `ShopwarePlugins\SwagJobQueue\Worker\Worker` interface.

```
use ShopwarePlugins\SwagJobQueue\JobQueue\Job;
use ShopwarePlugins\SwagJobQueue\JobQueue\Worker;
use Symfony\Component\Console\Output\OutputInterface;

class ExampleWorker implements Worker
{
    public function canHandle(Job $job)
    {
        return $job->getName() === 'example_job_name';
    }

    public function handle(Job $job, OutputInterface $output)
    {
        $args = $job->getArgs();
        // do some work with $args['foo']
    }
}
```

### Register worker

[](#register-worker)

The workers are registered in the queue via the shopware event `SwagJobQueueAddWorker`.

```
$this->subscribeEvent(
    'SwagJobQueue_Add_Worker',
    'onAddWorker'
);

public function onAddWorker($args)
{
    return ExampleWorker();
}
```

Examples
--------

[](#examples)

- [SwagAsyncImageGenerator](https://github.com/bcremer/SwagAsyncImageGenerator) - A example worker that replaces the default thumbnail generator with a async one.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0545dfa5917845b12373dfa688658be444a3e611aae930cc37840cf8f4acd01d?d=identicon)[bcremer](/maintainers/bcremer)

---

Top Contributors

[![bcremer](https://avatars.githubusercontent.com/u/55820?v=4)](https://github.com/bcremer "bcremer (4 commits)")

### Embed Badge

![Health badge](/badges/bcremer-swagjobqueue/health.svg)

```
[![Health](https://phpackages.com/badges/bcremer-swagjobqueue/health.svg)](https://phpackages.com/packages/bcremer-swagjobqueue)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[amphp/parser

A generator parser to make streaming parsers simple.

14952.8M16](/packages/amphp-parser)[amphp/serialization

Serialization tools for IPC and data storage in PHP.

13451.1M18](/packages/amphp-serialization)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[deliciousbrains/wp-background-processing

WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.

1.1k409.8k6](/packages/deliciousbrains-wp-background-processing)[react/async

Async utilities and fibers for ReactPHP

2238.8M170](/packages/react-async)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
