PHPackages                             vtitar/background-tasks-symfony - 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. vtitar/background-tasks-symfony

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

vtitar/background-tasks-symfony
===============================

Symfony BackgroundTasksBundle. Create and process tasks that will be executed via cron. Could be configured time when execute, separate process for specific task groups.

v0.1.2(1y ago)03MITPHPPHP &gt;=8.2

Since Feb 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vtitar/background-tasks-symfony)[ Packagist](https://packagist.org/packages/vtitar/background-tasks-symfony)[ RSS](/packages/vtitar-background-tasks-symfony/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

1. Bundle overview
==================

[](#1-bundle-overview)

Symfony BackgroundTasksBundle. Create and process tasks that will be executed via cron. Could be configured time when task should be executed, separate process for specific task groups.

2. Installation
===============

[](#2-installation)

### Install bundle

[](#install-bundle)

`composer require vtitar/background-tasks-symfony`

### Create db after installation

[](#create-db-after-installation)

`./bin/console doctrine:schema:update`

3. Configuration
================

[](#3-configuration)

- Add new cron config to crontab - will execute all tasks without specific group

`* * * * *   /usr/bin/flock -n /home/project/path/var/locks/cron-background-tasks.lock /home/project/path/bin/console tit:background-task:run > /home/project/path/var/log/cron-background-tasks.log 2>&1`

- In case you need to have separate process for some tasks to not block/wait main process - configure separate cron for tasks with specific group only

`* * * * *   /usr/bin/flock -n /home/project/path/var/locks/cron-background-tasks-group-test.lock /home/project/path/bin/console tit:background-task:run --group_code=test-group > /home/project/path/var/log/cron-background-tasks-group-test.log 2>&1`

4. How to use
=============

[](#4-how-to-use)

4.1 Add new entity to execution list
------------------------------------

[](#41-add-new-entity-to-execution-list)

### 4.1.1 Add via entityManager

[](#411-add-via-entitymanager)

New entity could be added via entityManager like

```
$task = new BackgroundTask();
$task->setCreatedAt(new DateTimeImmutable());
...
$this->entityManager->persist($task);
$this->entityManager->flush();
```

### 4.1.2 Add via BackgroundTaskManager

[](#412-add-via-backgroundtaskmanager)

Or BackgroundTaskManager could be used. Add `tit.background_tasks.manager.background_task` service to your service where you want to use it. Add to controller like

```
public function __construct(
    private readonly BackgroundTaskManager      $backgroundTaskManager
){}
```

And add new task

```
$params = [
    'request_id' => 123
];

$this->backgroundTaskManager->addNewTask(
    'tit.test.test', # service that will process task
    'handle', # function that will process task
    $params,
    '',
    null,
    50
);

$this->backgroundTaskManager->saveToDb();
```

4.2 Add service and function that should process task
-----------------------------------------------------

[](#42-add-service-and-function-that-should-process-task)

### 4.2.1 Service should be public

[](#421-service-should-be-public)

```

```

### 4.2.2 Add function that will process task

[](#422-add-function-that-will-process-task)

```
public function handle(array $params): void
{
    $requestId = $params['request_id'];
    // do whatever you need
}
```

4.3 Errors checking
-------------------

[](#43-errors-checking)

You could easily check is task executed okay via db `background_task.status` column.

- error - status should be -1. Error should be saved in `background_task.last_error` column.
- if you want to add task back to queue - set `status` to 0

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance44

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

441d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/007140abca492ca94e86761b06fbfe85905abe2817a694586fb7bb5ee9ce17c6?d=identicon)[vtitar](/maintainers/vtitar)

---

Top Contributors

[![VladTitSf9](https://avatars.githubusercontent.com/u/56590881?v=4)](https://github.com/VladTitSf9 "VladTitSf9 (4 commits)")[![vtitar](https://avatars.githubusercontent.com/u/152653362?v=4)](https://github.com/vtitar "vtitar (1 commits)")

### Embed Badge

![Health badge](/badges/vtitar-background-tasks-symfony/health.svg)

```
[![Health](https://phpackages.com/badges/vtitar-background-tasks-symfony/health.svg)](https://phpackages.com/packages/vtitar-background-tasks-symfony)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[novosga/novosga

Customer queue management system

26457.9k](/packages/novosga-novosga)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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