{"id":33951929,"url":"https://github.com/discorgento/module-queue","last_synced_at":"2026-04-07T04:32:01.632Z","repository":{"id":41355670,"uuid":"464944866","full_name":"discorgento/module-queue","owner":"discorgento","description":"A dev-friendly approach to handle background jobs in Magento 2 🔃","archived":false,"fork":false,"pushed_at":"2026-01-14T22:27:35.000Z","size":1754,"stargazers_count":45,"open_issues_count":3,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-15T04:50:11.041Z","etag":null,"topics":["background-jobs","hacktoberfest","magento2","magento2-extension-free","magento2-module","parallel-computing","performance"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/discorgento/module-queue","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discorgento.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-01T15:16:41.000Z","updated_at":"2026-01-14T22:27:51.000Z","dependencies_parsed_at":"2023-12-20T12:08:15.045Z","dependency_job_id":"0c2afdd6-b459-4f77-a8fd-6a0898d7882e","html_url":"https://github.com/discorgento/module-queue","commit_stats":{"total_commits":91,"total_committers":4,"mean_commits":22.75,"dds":0.09890109890109888,"last_synced_commit":"bcdd82b87628b0acfbc91ae29215cf742869197a"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/discorgento/module-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discorgento%2Fmodule-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discorgento%2Fmodule-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discorgento%2Fmodule-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discorgento%2Fmodule-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discorgento","download_url":"https://codeload.github.com/discorgento/module-queue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discorgento%2Fmodule-queue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31500397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["background-jobs","hacktoberfest","magento2","magento2-extension-free","magento2-module","parallel-computing","performance"],"created_at":"2025-12-12T19:14:29.441Z","updated_at":"2026-04-07T04:32:01.622Z","avatar_url":"https://github.com/discorgento.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Discorgento Queue](docs/header.png)\n\n\u003cp align=\"center\"\u003eA dev-friendly approach to handle background jobs in Magento 2\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/discorgento/module-queue/stargazers\" target=\"_blank\"\u003e\u003cimg alt=\"GitHub Stars\" src=\"https://img.shields.io/github/stars/discorgento/module-queue?style=social\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/discorgento/module-queue/stats\" target=\"_blank\"\u003e\u003cimg alt=\"Total Downloads\" src=\"https://img.shields.io/packagist/dt/discorgento/module-queue\"/\u003e\u003c/a\u003e\n    \u003ca target=\"_blank\" href=\"https://packagist.org/packages/discorgento/module-queue\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/discorgento/module-queue\" alt=\"Latest Version on Packagist\"\u003e\u003c/a\u003e\n    \u003ca target=\"_blank\" href=\"https://discord.io/Discorgento\"\u003e\u003cimg alt=\"Join our Discord\" src=\"https://img.shields.io/discord/768653248902332428?color=%237289d9\u0026label=Discord\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eOur Sponsors\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.caravelx.com/\"\u003e\u003cimg src=\"docs/sponsors/caravelx.svg\" alt=\"Caravel X\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Overview 💭\nNow 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.\n\nFor 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.\n\n![Linear Workflow](docs/linear-workflow.png)\n\nBut fear not citizens, because [we](https://discorgento.com/discord) are here!  \n![All Might laughting](docs/we-are-here.gif)\n\n## Install 🔧\nThis module is compatible with both Magento 2.3 and 2.4, from PHP 7.3 to 8.3.\n```\ncomposer require discorgento/module-queue:^3 \u0026\u0026 bin/magento setup:upgrade\n```\n\n## Usage ⚙️\n\u003e 💡 **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!\n\n\u003cbr\u003e\n\nIt's really simple, there's just two steps needed:\n - append a [job](https://github.com/discorgento/module-queue/wiki/Glossary) to the queue;\n - create the job class itself ([similar to Laravel](https://laravel.com/docs/9.x/queues#class-structure)).\n\n![Async Workflow](docs/async-workflow.png)\n\nLet's go back to the product sync example. You can now write the `catalog_product_save_after` observer like this:\n\n```php\n\u003c?php declare(strict_types=1);\n\nnamespace YourCompany\\YourModule\\Observer;\n\nuse Discorgento\\Queue\\Api\\QueueManagementInterface;\nuse Magento\\Framework\\Event;\n\nclass ProductSaveAfter implements Event\\ObserverInterface\n{\n    private QueueManagementInterface $queueManagement;\n\n    public function __construct(\n        QueueManagementInterface $queueManagement\n    ) {\n        $this-\u003equeueManagement = $queueManagement;\n    }\n\n    /** @inheritDoc */\n    public function execute(Event\\Observer $observer) {\n        // append a job to the queue so it will run in background\n        $this-\u003equeueManagement-\u003eappend(\n            // your job class, we'll create it later\n            \\YourCompany\\YourModule\\Job\\SyncProduct::class,\n            // a identifier of the entity we'll be working with\n            $observer-\u003egetProduct()-\u003egetId(),\n            // (optional) additional data for later usage\n            ['foo' =\u003e $observer-\u003egetFoo()]\n        );\n    }\n}\n```\n\n\u003cbr\u003e\n\nNow create the job itself, let's say \u003ci\u003eapp/code/YourCompany/YourModule/Job/SyncProduct.php\u003c/i\u003e:\n\n```php\n\u003c?php declare(strict_types=1);\n\nnamespace YourCompany\\YourModule\\Job;\n\nuse Discorgento\\Queue\\Api\\JobInterface;\nuse Magento\\Catalog\\Api\\ProductRepositoryInterface;\nuse YourCompany\\YourModule\\Gateway\\ProductSyncer;\n\n// the job MUST implement the JobInterface\nclass SyncProduct implements JobInterface\n{\n    private ProductRepositoryInterface $productRepository;\n    private ProductSyncer $productSynchronizer;\n\n    public function __construct(\n        ProductRepositoryInterface $productRepository,\n        ProductSyncer $productSynchronizer\n    ) {\n        $this-\u003eproductRepository = $productRepository;\n        $this-\u003eproductSynchronizer = $productSynchronizer;\n    }\n\n    /** @inheritDoc */\n    public function execute($target, $additionalData)\n    {\n        // retrieve the target product\n        $product = $this-\u003eproductRepository-\u003egetById($target);\n\n        // optional additional data usage example\n        $product-\u003esetFoo($additionalData['foo'] ?? null);\n\n        // sync it to a third-party PIM/ERP\n        $response = $this-\u003eproductSynchronizer-\u003esync($product);\n\n        // NEW!! Now you can optionally return a string as the job \"result\".\n        // This will be shown at admin in \"System-\u003e(Tools) Queue Management\"\n        return \"Synced. ID on PIM: {$response-\u003epim_id}\";\n    }\n}\n```\n\nAnd.. that's it! In the next cron iteration (which should be within five minutes) your job will be executed without compromising the performance of the store, assuring a smooth workflow for both your clients and their customers.\n\n\u003e 💡 **Tip:** any async process can benefit from this approach, your creativity is the limit.\n\n## Managing the queue 🆕\nYou can track the queued jobs status and their respective output with our brand new Queue Management grid, accessible through the \"System-\u003e(Tools) Queue Management\" menu (near to the native cache/index management entries):\n\n![Queue Management Grid Preview](docs/admin-grid.png)\n\u003e 💡 **Tip:** for more info about all the actions available in this grid please refer to [its documentation](https://github.com/discorgento/module-queue/wiki/Managing-the-queue).\n\n## Advanced features 🤖\nAlthough this module was \u003cabbr title=\"originally it was designed for 1.9 due to 1.x lack of a native queue feature\"\u003eported\u003c/abbr\u003e to Magento 2 due to its simplicity, over the time it also got some really neat tricks! So if want to do more with it, don't forget to check the [official wiki](https://github.com/discorgento/module-queue/wiki).\n\n## Notes 🗒\n - Magento can do this natively through [Message Queues](https://developer.adobe.com/commerce/php/development/components/message-queues/), but those are ridiculously verbose to use;\n - issues and PRs are welcome in this repo;\n - we want **YOU** for [our community](https://discorgento.com/discord)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscorgento%2Fmodule-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscorgento%2Fmodule-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscorgento%2Fmodule-queue/lists"}