{"id":22307466,"url":"https://github.com/imroychen/php-async-queue","last_synced_at":"2025-03-26T01:22:22.269Z","repository":{"id":56993581,"uuid":"405142094","full_name":"imroychen/php-async-queue","owner":"imroychen","description":"A simple asynchronous queue library.(一个简单php异步队列库)","archived":false,"fork":false,"pushed_at":"2023-01-13T15:44:57.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T22:47:32.994Z","etag":null,"topics":["async","php-async-queue","php-queue","queue"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imroychen.png","metadata":{"files":{"readme":"README-EN.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":"2021-09-10T16:18:18.000Z","updated_at":"2022-12-14T23:50:27.000Z","dependencies_parsed_at":"2023-02-09T16:15:58.412Z","dependency_job_id":null,"html_url":"https://github.com/imroychen/php-async-queue","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imroychen%2Fphp-async-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imroychen%2Fphp-async-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imroychen%2Fphp-async-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imroychen%2Fphp-async-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imroychen","download_url":"https://codeload.github.com/imroychen/php-async-queue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245569063,"owners_count":20636880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["async","php-async-queue","php-queue","queue"],"created_at":"2024-12-03T20:09:54.788Z","updated_at":"2025-03-26T01:22:22.244Z","avatar_url":"https://github.com/imroychen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[中文简体](README.md)  /  English\r\n# Readme\r\nA simple asynchronous queue library.\r\n## Installation\r\ncomposer require iry/queue\r\n\r\n## How to use\r\n\r\n### 1. Queue configuration\r\n\u003eCreate a class to implement the following methods。([Example](example/QueueConfig/SettingTest.php))\r\nThere can be multiple queues in a project, please create a configuration for each queue (Setting)\r\n\u003e \r\n\u003e Interface: [src/SettingInterface.php](src/SettingInterface.php)\r\n\r\n\r\n```php\r\nnamespace MyNamespace;//This is the namespace of your project\r\n//\r\nclass MySetting extends \\iry\\queue\\Setting{\r\n    function storage();\r\n    function tempPath(){}\r\n    \r\n    //function beforeCreate($name, $client);// 任务入队前回调, return false 阻止任务继续入队\r\n    \r\n    //function afterCreate($id);\r\n    \r\n    //function i18n(){ return 'en-US'; } // en-US，zh-CN or file://.\r\n}\r\n```\r\n\r\n### 2.Create new task (client)\r\n```php \r\nuse iry\\queue\\Client\r\nClient::m(\\MyNamespace\\MySetting::class)-\u003ecreate($name,$args,$tags ,$execTime)\r\n```\r\n**create**(_$name, $args, $tags ,$execTime, $unique=true_) ([Example](./example/CreateTask.php))\r\n\r\nParameter name|Type|Description\r\n---|---|---\r\n$name|string|Task name: (letters/numbers/ _) and other characters\r\n$args|array|arguments .E.G:['id'=\u003e123]\r\n$tags|array|\r\n$execTime|array|The execution time is used to delay the queue.\r\n\r\n### 3. Monitor and execute asynchronous tasks, only support CLI mode (server side)\r\n```php \r\nuse iry\\queue\\Service\r\n\r\nnew Service()-\u003elisten()\r\n```\r\n---\r\n# 注：\r\n## MySetting::storage\r\n[Info](./src/Setting.php)\r\n\r\n[E.g.](./example/Queue2Config/MyDbStorage.php)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimroychen%2Fphp-async-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimroychen%2Fphp-async-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimroychen%2Fphp-async-queue/lists"}