koenbetsens/jobserver

Gearman Jobserver Integration
664 4
Install
composer require koenbetsens/jobserver
PHP:>=5.4.0
License:MIT
Last Updated:Sep 28, 2015
Links: GitHub  ·  Packagist
Maintainer: koenbetsens

JobServer

Gearman JobServer implementation for Laravel

Gearman

Gearman is a MQ (Message Queue) provider with foreground and background capabilities. This makes it one of the few PHP-suited synchronous MQ handlers.

gearman.org

Laravel

Laravel is on of the leanest and meanest PHP Frameworks around - perfectly suited for rest API projects.

laravel.com


The package

The Jobserver package is a Gearman dispatch implementation for Laravel. The package functions as an abstraction layer to send both foreground as background jobs to a MQ server (Gearman in this case). The Jobserver package is taylored to use in the 3-layer structure (app <-> api <-> worker).

Read more about installing and using the jobserver package here:

3-layer - JobServer package

3-Layer - Set up Message Queueing


Implementation

Add the package to your API dependencies. To use the local "synced" mode - skipping a local Gearman installation - add the models/Ghostjob.php file to your worker app/models directory. To make the synced connection between the API and worker job function work, add "echo Ghostjob::evaluate ('controllerDispatch', $argv);" to the end of the required function files.

Installation

Add the Jobserver package to the composer requirements of your API project. In project/composer.json, add the koenbetsens/jobserver entry