{"id":18790656,"url":"https://github.com/pafelin/laravel-gearman","last_synced_at":"2025-08-05T08:21:20.561Z","repository":{"id":10595177,"uuid":"12808539","full_name":"pafelin/laravel-gearman","owner":"pafelin","description":"register gearmand queue manager for laravel","archived":false,"fork":false,"pushed_at":"2020-11-27T02:22:45.000Z","size":27,"stargazers_count":63,"open_issues_count":1,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-09T19:53:41.565Z","etag":null,"topics":["gearman","laravel","php","queue"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tomchentw/angular-ujs","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pafelin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-13T12:03:34.000Z","updated_at":"2024-03-14T15:15:45.000Z","dependencies_parsed_at":"2022-09-17T04:31:27.922Z","dependency_job_id":null,"html_url":"https://github.com/pafelin/laravel-gearman","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pafelin%2Flaravel-gearman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pafelin%2Flaravel-gearman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pafelin%2Flaravel-gearman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pafelin%2Flaravel-gearman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pafelin","download_url":"https://codeload.github.com/pafelin/laravel-gearman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230374126,"owners_count":18216042,"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":["gearman","laravel","php","queue"],"created_at":"2024-11-07T21:13:12.409Z","updated_at":"2024-12-19T04:07:45.734Z","avatar_url":"https://github.com/pafelin.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nThis package gives you the possibily to add gearman as native queue back-end service\n\n#Installation\n\nfirst you need to add it to your composer.json\n\nsecond, in `config/app.php`, you need to comment out the native queue service provider\n\n    //'Illuminate\\Queue\\QueueServiceProvider',\n\nand to put this instead:\n\n    'Pafelin\\Gearman\\GearmanServiceProvider',\n\nThen in your config/queue.php file you can add:\n\n    'default' =\u003e 'gearman',\n    'connections' =\u003e array(\n        'gearman' =\u003e array(\n            'driver' =\u003e 'gearman',\n            'host'   =\u003e 'localserver.6min.local',\n            'queue'  =\u003e 'default',\n            'port'   =\u003e 4730,\n            'timeout' =\u003e 1000 //milliseconds\n        )\n    )\n\nor, if you have multiple gearman servers:\n\n    'default' =\u003e 'gearman',\n    'connections' =\u003e array(\n        'gearman' =\u003e array(\n            'driver' =\u003e 'gearman',\n            'hosts'  =\u003e array(\n                array('host' =\u003e 'localserver.6min.local', 'port' =\u003e 4730),\n                array('host' =\u003e 'localserver2.6min.local', 'port' =\u003e 4730),\n            ),\n            'queue'  =\u003e 'default',\n            'timeout' =\u003e 1000 //milliseconds\n        )\n    )\n\nThen in your code you can add code as (this is the native way to add jobs to the queue):\n\n    Queue::push('SomeClass', array('message' =\u003e 'The data that should be available in the SomeClass@fire method'));\n\nSmall hint, you can call Namespaced classes and everything that is written in the docs of laravel for calling custom methods is valid here, too.\n\n\n# Example:\n\nI add a \"service\" folder to my app folder and inside I create a file \"SendMail.php\"\nThe code of the class is here:\n\n    \u003c?php\n\n    namespace TaskProcess\\Services;\n\n    class SendMail {\n\n        public function fire($job, $data)\n        {\n            //I send an email to my email address with subject \"gearman test\" and message whatever comes from gearman\n            mail('pavel@taskprocess.com', 'gearman test', $data['message']);\n        }\n\n    }\n\nIn my routes file I add a new Route\n\n\n    Route::get('/gearman', function() {\n        //in a loop I add 3 jobs to gearman with different content. The purpose is to see 3 different emails with 3 different contents\n        foreach (array(1,2,3) as $row) {\n            Queue::push('TaskProcess\\Services\\SendMail', array('message' =\u003e 'Message №' . $row));\n        }\n    });\n\nFinally I just run on my console:\n\n    php artisan queue:listen\n\nAnd I go to check what's on my email\n\n#Bugs\n\nPlease if you notice a bug open an issue or submit request. \n\nHope this package will help you\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpafelin%2Flaravel-gearman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpafelin%2Flaravel-gearman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpafelin%2Flaravel-gearman/lists"}