GithubHelp home page GithubHelp logo

net_gearman's Introduction

Net Gearman

About

Net_Gearman is a package for interfacing with Gearman. Gearman is a system to farm out work to other machines, dispatching function calls to machines that are better suited to do work, to do work in parallel, to load balance lots of function calls, or to call functions between languages.

Installation

$ composer require brianlmoon/net_gearman

Examples

Client

$client = new Net_Gearman_Client("localhost");
$set = new Net_Gearman_Set();
$task = new Net_Gearman_Task("Reverse_String", "foobar");
$task->attachCallback(
    function($func, $handle, $result){
        print_r($result)
    }
);
$set->addTask($task);
$client->runSet($set, $timeout);

Job

class Reverse_String extends Net_Gearman_Job_Common {

    public function run($workload) {
        $result = strrev($workload);
        return $result;
    }
}

Worker

For easiest use, use GearmanManager for running workers. See: https://github.com/brianlmoon/GearmanManager

$worker = new Net_Gearman_Worker('localhost');
$worker->addAbility('Reverse_String');
$worker->beginWork();

net_gearman's People

Contributors

brianlmoon avatar till avatar j03k64 avatar joestump avatar lenn0x avatar bkw avatar strayer avatar bdeshong avatar bmovi avatar rokclimb15 avatar ddebin avatar dynamicnet avatar eschultz avatar etienneq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.