{"id":20330553,"url":"https://github.com/mle86/php-wq-amqp","last_synced_at":"2026-05-30T18:31:37.183Z","repository":{"id":41081489,"uuid":"140100192","full_name":"mle86/php-wq-amqp","owner":"mle86","description":"An AMQP adapter for WQ (https://github.com/mle86/php-wq)","archived":false,"fork":false,"pushed_at":"2025-09-11T09:51:37.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-11T12:43:54.319Z","etag":null,"topics":["amqp","amqp-client","php","php-library","rabbitmq","rabbitmq-client","work-queue","wq"],"latest_commit_sha":null,"homepage":null,"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/mle86.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}},"created_at":"2018-07-07T16:33:39.000Z","updated_at":"2022-04-25T20:56:03.000Z","dependencies_parsed_at":"2022-08-31T04:30:43.773Z","dependency_job_id":null,"html_url":"https://github.com/mle86/php-wq-amqp","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/mle86/php-wq-amqp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-amqp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-amqp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-amqp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-amqp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mle86","download_url":"https://codeload.github.com/mle86/php-wq-amqp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-amqp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33705207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["amqp","amqp-client","php","php-library","rabbitmq","rabbitmq-client","work-queue","wq"],"created_at":"2024-11-14T20:16:38.652Z","updated_at":"2026-05-30T18:31:37.160Z","avatar_url":"https://github.com/mle86.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WQ-AMQP  (`mle86/wq-amqp`)\n\nThis package contains the PHP class\n\u003ccode\u003emle86\\WQ\\WorkServerAdapter\\\\\u003cb\u003eAMQPWorkServer\u003c/b\u003e\u003c/code\u003e.\n\nIt supplements the\n[**mle86/wq**](https://github.com/mle86/php-wq) package\nby implementing its `WorkServerAdapter` interface.\n\nIt connects to an AMQP server\nsuch as [RabbitMQ](https://www.rabbitmq.com/)\nusing the [php-amqplib/php-amqplib](https://github.com/php-amqplib/php-amqplib) package.\n\nIt creates durable queues in the default exchange (“”) for immediate-delivery jobs\nand the durable “`_phpwq._delayed`” queue in the custom “`_phpwq._delay_exchange`” exchange for delayed jobs.\nJobs stored with `storeJob()` are always durable as well.\nEmpty queues or exchanges won't be deleted automatically.\n\n\n# Version and Compatibility\n\nThis is\n**version 1.4.0**\nof `mle86/wq-amqp`.\n\nIt was developed for\nversion 1.0.0\nof `mle86/wq`\nand should be compatible\nwith all of its future 1.x versions as well.\n\n\n# Installation and Dependencies\n\n```\n$ composer require mle86/wq-amqp\n```\n\nIt requires PHP 8.0+.\n\nIt depends on\n[mle86/wq](https://github.com/mle86/php-wq)\nand [php-amqplib/php-amqplib](https://github.com/php-amqplib/php-amqplib),\nwhich in turn requires the\n[mbstring](https://php.net/manual/book.mbstring.php),\n[sockets](https://php.net/manual/book.sockets.php),\nand\n[bcmath](https://php.net/manual/book.bc.php)\nPHP extensions.\n\n\n# Class reference\n\n\u003ccode\u003eclass mle86\\WQ\\WorkServerAdapter\\\\\u003cb\u003eAMQPWorkServer\u003c/b\u003e implements WorkServerAdapter\u003c/code\u003e\n\n* \u003ccode\u003epublic function \u003cb\u003e__construct\u003c/b\u003e (AMQPStreamConnection $connection)\u003c/code\u003e  \n    Constructor.\n    Takes an already-configured `AMQPStreamConnection` instance to work with.\n    Does not attempt to establish a connection itself –\n    use the `connect()` factory method for that instead.\n* \u003ccode\u003epublic static function \u003cb\u003econnect\u003c/b\u003e ($host = 'localhost', $port = 5672, $user = 'guest', $password = 'guest', $vhost = '/', $insist = false, $login\\_method = 'AMQPLAIN', $login\\_response = null, $locale = 'en\\_US', $connection\\_timeout = 3.0, $read\\_write\\_timeout = 3.0, $context = null, $keepalive = false, $heartbeat = 0)\u003c/code\u003e  \n    Factory method.\n    See [AMQPStreamConnection::__construct](https://github.com/php-amqplib/php-amqplib/blob/v2.7.2/PhpAmqpLib/Connection/AMQPStreamConnection.php#L8)\n    for the parameter descriptions.\n\nInterface methods\nwhich are documented in the [`WorkServerAdapter`](https://github.com/mle86/php-wq/blob/master/doc/Ref_WorkServerAdapter_interface.md) interface:\n\n* \u003ccode\u003epublic function \u003cb\u003estoreJob\u003c/b\u003e (string $workQueue, Job $job, int $delay = 0)\u003c/code\u003e\n* \u003ccode\u003epublic function \u003cb\u003egetNextQueueEntry\u003c/b\u003e ($workQueue, int $timeout = DEFAULT\\_TIMEOUT): ?QueueEntry\u003c/code\u003e\n* \u003ccode\u003epublic function \u003cb\u003eburyEntry\u003c/b\u003e (QueueEntry $entry)\u003c/code\u003e\n* \u003ccode\u003epublic function \u003cb\u003erequeueEntry\u003c/b\u003e (QueueEntry $entry, int $delay, string $workQueue = null)\u003c/code\u003e\n* \u003ccode\u003epublic function \u003cb\u003edeleteEntry\u003c/b\u003e (QueueEntry $entry)\u003c/code\u003e\n\n\n# Usage example\n\n```php\n\u003c?php\nuse mle86\\WQ\\WorkServerAdapter\\AMQPWorkServer;\nuse mle86\\WQ\\WorkProcessor;\nuse mle86\\WQ\\Job\\Job;\n\n$processor = new WorkProcessor( AMQPWorkServer::connect(\"localhost\") );\n\nwhile (true) {\n    $processor-\u003eprocessNextJob(\"mail\", function(Job $job) {\n        $job-\u003e...;\n    });\n}\n```\n\nThis executes all jobs available in the local AMQP server's “`mail`” queue, forever.\nIt will however abort if one of the jobs throws an exception –\nyou might want to add a logging try-catch block around the `processNextJob()` call\nas shown in [WQ's “Quick Start” example](https://github.com/mle86/php-wq#quick-start).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmle86%2Fphp-wq-amqp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmle86%2Fphp-wq-amqp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmle86%2Fphp-wq-amqp/lists"}