PHPackages                             polysource/bulk-async - 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. polysource/bulk-async

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

polysource/bulk-async
=====================

Polysource — async bulk actions via Symfony Messenger + live progress via Mercure SSE.

v0.9.0(2mo ago)09MITPHP &gt;=8.1

Since May 10Compare

[ Source](https://github.com/polysource/bulk-async)[ Packagist](https://packagist.org/packages/polysource/bulk-async)[ Docs](https://github.com/polysource/polysource)[ RSS](/packages/polysource-bulk-async/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (14)Versions (26)Used By (0)

polysource/bulk-async
=====================

[](#polysourcebulk-async)

> Asynchronous bulk actions for Polysource — execute over Symfony Messenger with live progress (Mercure) and cancel mid-flight.

Part of the [Polysource](https://github.com/polysource/polysource) monorepo. MIT-licensed.

When to use
-----------

[](#when-to-use)

The synchronous bulk action ("Retry 5 000 failed messages") times out after 30 s in production. This package fans the work out to Messenger workers, persists per-job progress every 5 records or 500 ms, and exposes a JSON endpoint + Mercure topic so the UI can show a live progress bar and a "Cancel" button.

See [ADR-024](../../docs/adr/0024-bulk-async-mercure.md).

What it ships
-------------

[](#what-it-ships)

- **`BulkJob`** immutable VO (12 fields, 8 KiB error cap) + **`BulkJobStatus`** enum (5 states, `isTerminal()`).
- **`BulkJobStorageInterface`** + **`DoctrineBulkJobStorage`** + Doctrine entity.
- **`BulkJobMessage`** + **`BulkJobHandler`** — re-fetches each iteration to honour Cancelled, throttled persist (5 records OR 500 ms), per-record exception isolation.
- **`AsyncBulkActionDispatcher`** — UUID v7 + Pending persist + Messenger dispatch.
- **`AsyncAwareBulkActionInterface`** — opt-in marker (parallel interface, no BC break to `BulkActionInterface`).
- **`BulkJobResource`** — browsable admin resource (`#[AsResource]`, slug `bulk-jobs`).
- **`CancelBulkJobAction`** — idempotent on terminal, gated `POLYSOURCE_BULK_JOB_CANCEL`.
- **`ProgressController`** — JSON `GET /admin/bulk-jobs/{id}/progress`. Two-stage gate: coarse `POLYSOURCE_BULK_JOB_VIEW` permission + ownership check (requester must own the job, or hold `POLYSOURCE_BULK_JOB_VIEW_ANY`).
- **`MercureBulkJobBroadcaster`** — gated on `class_exists(HubInterface)`, hub failures swallowed, topic `polysource/bulk-jobs/{actorId}/{id}` (actor segment URL-encoded). Pair with the `polysource_bulk_progress_topic(job)` Twig helper so client and broadcaster always agree on the topic shape; configure your Mercure JWT subscriber claims to restrict per-actor for defence-in-depth.
- **Stimulus `progress_controller.js`** — EventSource Mercure → polling fallback auto on error.

Install
-------

[](#install)

```
composer require polysource/bulk-async symfony/messenger
# Optional but recommended for live progress:
composer require symfony/mercure-bundle
```

Register the bundle:

```
return [
    Polysource\BulkAsync\PolysourceBulkAsyncBundle::class => ['all' => true],
];
```

Run the migration to create `polysource_bulk_jobs`.

Extend it
---------

[](#extend-it)

`BulkJobStorageInterface` is **3 methods**. To persist jobs in Redis / Mongo / your service instead of Doctrine, implement it and alias the interface to your service in DI. The handler, the `ProgressController`, the Mercure broadcaster all keep working.

See [extensibility map](../../docs/user/extensibility.md#11-14-the-rest-in-one-breath).

Documentation
-------------

[](#documentation)

- [Bulk-async walkthrough](../../docs/user/bulk-async/)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance86

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

25

Last Release

68d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41d53ab82016651b0a4a9ef71644a54f934d8bf54ccbc59fc0183f994213ef38?d=identicon)[samaym](/maintainers/samaym)

---

Tags

asyncsymfonymercureMessengerbulkpolysource

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/polysource-bulk-async/health.svg)

```
[![Health](https://phpackages.com/badges/polysource-bulk-async/health.svg)](https://phpackages.com/packages/polysource-bulk-async)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M400](/packages/easycorp-easyadmin-bundle)[open-dxp/opendxp

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

9421.6k64](/packages/open-dxp-opendxp)[chameleon-system/chameleon-base

The Chameleon System core.

1028.7k5](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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