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 today

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

25

—

LowBetter than 35% of packages

Maintenance41

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

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

492d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/152653362?v=4)[Vladyslav Tytarenko](/maintainers/vtitar)[@vtitar](https://github.com/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

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M386](/packages/easycorp-easyadmin-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[pimcore/pimcore

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

3.8k3.8M508](/packages/pimcore-pimcore)[prestashop/prestashop

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

9.1k17.8k](/packages/prestashop-prestashop)

PHPackages © 2026

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