PHPackages                             discorgento/module-queue - 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. discorgento/module-queue

ActiveMagento2-module[Queues &amp; Workers](/categories/queues)

discorgento/module-queue
========================

A dev-friendly approach to handle background jobs in Magento 2

3.5.1(4mo ago)4512.4k↓50%10[1 issues](https://github.com/discorgento/module-queue/issues)[1 PRs](https://github.com/discorgento/module-queue/pulls)MITPHPPHP &gt;=7.4.0 &lt;8.5

Since Mar 1Pushed 4mo ago5 watchersCompare

[ Source](https://github.com/discorgento/module-queue)[ Packagist](https://packagist.org/packages/discorgento/module-queue)[ RSS](/packages/discorgento-module-queue/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (30)Used By (0)

[![Discorgento Queue](docs/header.png)](docs/header.png)

A dev-friendly approach to handle background jobs in Magento 2

 [![GitHub Stars](https://camo.githubusercontent.com/86206b84875650a16f48dba24feae0e868ae42e65b09faf3fef6b4b95be4612a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f646973636f7267656e746f2f6d6f64756c652d71756575653f7374796c653d736f6369616c)](https://github.com/discorgento/module-queue/stargazers) [![Total Downloads](https://camo.githubusercontent.com/017bc1ffc3c4c78cde2e0bbb1de8498ca8281a9dffc38b7d5dee044286765961/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646973636f7267656e746f2f6d6f64756c652d7175657565)](https://packagist.org/packages/discorgento/module-queue/stats) [![Latest Version on Packagist](https://camo.githubusercontent.com/d6d53d9564a981484548b680c5ad685023dc9257f804e4a07ae1f83f3eb3d7df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646973636f7267656e746f2f6d6f64756c652d7175657565)](https://packagist.org/packages/discorgento/module-queue) [![Join our Discord](https://camo.githubusercontent.com/c448784fc6c083dd1207f1fa1f0b89cf402e27bdb1a717cf558d4f56c3da4ecf/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3736383635333234383930323333323432383f636f6c6f723d253233373238396439266c6162656c3d446973636f7264)](https://discord.io/Discorgento)

Our Sponsors

 [![Caravel X](docs/sponsors/caravelx.svg)](https://www.caravelx.com/)

Overview 💭
----------

[](#overview-)

Now and then we need to create processes that can take some time to execute, and that doesn't necessarily need to be done in real time. Like (but not limited to) third-party integrations.

For example, let's say you need to reflect product changes made by the storekeeper through the admin panel to their PIM/ERP. You can observe the `catalog_product_save_after` event and push the changes, but this would make the "Save" admin action become a hostage of the third-party system response time, potentially making the store admin reeealy slow.

[![Linear Workflow](docs/linear-workflow.png)](docs/linear-workflow.png)

But fear not citizens, because [we](https://discorgento.com/discord) are here!
[![All Might laughting](docs/we-are-here.gif)](docs/we-are-here.gif)

Install 🔧
---------

[](#install-)

This module is compatible with both Magento 2.3 and 2.4, from PHP 7.3 to 8.3.

```
composer require discorgento/module-queue:^3 && bin/magento setup:upgrade

```

Usage ⚙️
--------

[](#usage-️)

> 💡 **Tip:** for 2.x version please refer to the old docs [here](https://github.com/discorgento/module-queue/blob/2.0.4/README.md#usage-%EF%B8%8F). Just remember: the current version is 100% retrocompatible, so you can [upgrade](https://github.com/discorgento/module-queue/wiki/Upgrading-from-2.x) and use all the new features without breaking your existant code!

It's really simple, there's just two steps needed:

- append a [job](https://github.com/discorgento/module-queue/wiki/Glossary) to the queue;
- create the job class itself ([similar to Laravel](https://laravel.com/docs/9.x/queues#class-structure)).

[![Async Workflow](docs/async-workflow.png)](docs/async-workflow.png)

Let's go back to the product sync example. You can now write the `catalog_product_save_after` observer like this:

```
