Coder Social home page Coder Social logo

node-gearman's People

Contributors

alz avatar andris9 avatar aredridel avatar enobrev avatar julesau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-gearman's Issues

how to hold the payload on work.error()

var Gearman = require("../lib/gearman"),
    gearman = new Gearman();  // defaults to localhost

gearman.registerWorker("reverse", function(payload, worker){

workerFunc(payload);

function workerFunc(payload)
{
    if(somthing error){
       worker.error();
       return;
    }
}

});

when worker.error() is do, the payload will be delete from the reverse, but I want another worker to do the payload.

how to do?

Mysterious JSON.parse error when running a background job

Example

I pass stringified objects to all of my workers. Those workers then parse the payload, do their thing, then return their result as a stringified object, which the recipient then parses.

This works great, when submitting a standard job. I'm encountering a mysterious issue when running background jobs, though (see above example).

For a foreground job, the incoming worker payload looks like this:

Incoming doSomething job <Buffer 7b 22 61 6e 69 6d 61 6c 73 22 3a 5b 22 63 61 74 73 22 2c 22 64 6f 67 73 22 5d 7d>

For a background job, the incoming worker payload looks like this:

Incoming doSomething job <Buffer 7b 22 61 6e 69 6d 61 6c 73 22 3a 5b 22 63 61 74 73 22 2c 22 64 6f 67 73 22 5d 7d 00>

Note the extra 00 on the tail end there. This is causing my JSON to fail to be parsed, even though it looks identical. Any idea what's going on here?

Only 1 worker possible per process

For example, this coffeescript code

NodeGearman = require 'node-gearman'

gearman = new NodeGearman 'localhost', 4730

for i in [1..5]
    gearman.registerWorker "test", (payload, worker) =>
        setTimeout =>
            worker.end()
        , 5000

should make 5 workers instead of one, making the queue processed at a rate of 1 task per second. Instead only 1 worker gets created.

work_exception

How I should handle WORK_EXCEPTION? Problem:

var job = gearman.submitJob("someworker", data);
job.on("error", function(error) {
// this doesn't work when WORK_EXCEPTION is returned by worker
// works well when worker return WORK_FAIL
});

How to get the handle?

Hello everybody!

I want to be able to start / stop multiple background jobs from a webpage using node.js. However I can't seem to find a way to get the handle to identify the job:

receiveHandle only returns "invalid response from server"

However, when I switch on Debug-Mode in the worker and job the handle is clearly visible in the output.

How can I read the handle to pass it to the webpage after job creation, so I can see which job is running?

Thank you very much in advance!
Markus

worker droped after few minitues

If worker through haproxy proxy to request gearman, worker will work for few minitues, and then droped,
do not know how to solve?

Updates

Is this repository still being updated?

how to add muti job servers?

I want to add 2 job servers as failover, how to do add 2 job servers? and how to register worker to muti job servers?

php have the method like this:

$gmclient= new GearmanClient();
$gmclient->addServers("10.0.0.1,10.0.0.2:7003");



$worker= new GearmanWorker(); 
$worker->addServers("10.0.0.1,10.0.0.2:7003");

After idling for a certain amount of time, the worker doesn't get the job?

Hi Andris,

Was wondering if you could help me here:

If I run the worker.js in the examples, and I let the script idle for a certain amount of time (overnight)...then the next morning when I submit a job, the worker doesn't get it. It's like it timed-out the connection or something?

I have to restart worker.js, and it seems to work again.

Thanks!
Felix

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.