PHPackages                             tarantool/jobserver - 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. tarantool/jobserver

ActiveProject[Queues &amp; Workers](/categories/queues)

tarantool/jobserver
===================

A skeleton application for creating and processing background jobs.

15183PHP

Since Nov 27Pushed 4y ago3 watchersCompare

[ Source](https://github.com/tarantool-php/jobserver)[ Packagist](https://packagist.org/packages/tarantool/jobserver)[ RSS](/packages/tarantool-jobserver/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (3)Used By (0)

JobServer
=========

[](#jobserver)

JobServer is a skeleton repository used for creating and processing background jobs backed by [Tarantool](http://tarantool.org/). It contains configuration files and folders you will need for quick start from scratch.

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

[](#installation)

The recommended way to create a new application is through [Composer](http://getcomposer.org):

```
composer create-project tarantool/jobserver -s dev
```

Quick start
-----------

[](#quick-start)

First, create your own `docker-compose.override.yml` file by copying [docker-compose.override.yml.dist](docker-compose.override.yml.dist) (or [docker-compose.override.yml.full.dist](docker-compose.override.yml.full.dist) if you want to test the full setup including a Tarantool cluster with automatic failover and monitoring tools) and customize to your needs. Do the same for [.env.dist](.env.dist) and all `*.dist` files located in [app/config](app/config) and [res](res).

Then, browse to the project directory and execute this command:

```
docker-compose up -d
```

After the command has completed successfully, you'll have a running server ready to execute jobs. If you open a log file in follow mode (`tail -f var/log/workers.log`), you'll see something like the following:

```
[2017-11-19 00:00:23] default:worker.DEBUG: Idling... [] []
[2017-11-19 00:00:24] default:worker.DEBUG: Idling... [] []
[2017-11-19 00:00:25] default:worker.DEBUG: Idling... [] []
```

Let's now try to add a task to the queue. This repository comes with a [demo job](src/UseCase/Greet/GreetHandler.php)that writes a greeting to the log. By running the following command:

```
docker-compose exec worker ./jobserver queue:put default -H tarantool \
    '{"payload": {"service": "greet", "args": {"name": "foobar"}}}'
```

we add a task to the `default` queue with a job payload, where `greet` is a job name and `foobar` is an argument passing to a job callable.

Now in the log you will see that the job is executed:

```
[2017-11-19 00:00:32] jobserver.INFO: HELLO FOOBAR [] []
[2017-11-19 00:00:33] default:worker.DEBUG: Idling... [] []
[2017-11-19 00:00:34] default:worker.INFO: Task #0 was successfully processed. {"payload":{"args":{"name":"foobar"},"service":"greet"}} []
```

Also, you can run the job directly in the console, bypassing the queue:

```
docker-compose exec worker ./jobserver -vvv handler:greet foobar
```

To be able to run a job from the console, you need to write an adapter for the symfony command and register it in [app/config/commands.php](app/config/commands.php). This is how the adapter looks like for GreetHandler: [GreetCommand](src/UseCase/Greet/GreetCommand.php).

To see a list of all registered commands, run:

```
docker-compose exec worker ./jobserver
```

Tarantool
---------

[](#tarantool)

To use a web interface for Tarantool, open your browser and access the [http://localhost:8001](http://localhost:8001/) address (make sure that Docker containers are running).

To get into Tarantool console as admin on a running Docker container, execute:

```
docker-compose exec tarantool tarantoolctl connect /var/run/tarantool/tarantool.sock
```

On a server:

```
sudo tarantoolctl enter jobserver_instance
```

On the server as a job queue user:

```
sudo tarantoolctl connect $TNT_JOBQUEUE_USER:$TNT_JOBQUEUE_PASSWORD@$TNT_JOBQUEUE_HOST:3301
```

Monitoring
----------

[](#monitoring)

Open your browser and access:

- [Prometheus](http://localhost:9090/)
- [Alert manager](http://localhost:9093/)
- [Grafana](http://localhost:3000/)

[![Grafana](/res/grafana/screenshot.png)](/res/grafana/screenshot.png)

> *Make sure to use a copy of [docker-compose.override.yml.full.dist](docker-compose.override.yml.full.dist)to have all monitoring containers running.*

Testing
-------

[](#testing)

```
docker-compose exec worker vendor/bin/phpunit
```

Debugging
---------

[](#debugging)

To debug a job runner, first, stop the worker container

```
docker-compose stop worker
```

Then, start listening for php debug connections and then execute:

```
LOCAL_IP= docker-compose run --rm worker bash -c ' \
    TNT_JOBQUEUE_PASSWORD=jobserver \
    vendor/bin/jobqueue run default \
    --config app/config/jobqueue.php \
    --executors-config app/config/executors.php \
    --user jobserver \
    --host tarantool \
'
```

> *Check [this manual](https://confluence.jetbrains.com/display/PhpStorm/Simultaneous+debugging+sessions+with+PhpStorm)to learn how to debug multiple processes (for example, the runner and background jobs) simultaneously in PhpStorm.*

License
-------

[](#license)

The library is released under the MIT License. See the bundled [LICENSE](LICENSE) file for details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

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://avatars.githubusercontent.com/u/533861?v=4)[Eugene Leonovich](/maintainers/rybakit)[@rybakit](https://github.com/rybakit)

---

Top Contributors

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

---

Tags

background-jobsjobserverskeletontarantoolworker

### Embed Badge

![Health badge](/badges/tarantool-jobserver/health.svg)

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

###  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.8M171](/packages/react-async)

PHPackages © 2026

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