Git Product home page Git Product logo

Comments (4)

niklasfemerstrand avatar niklasfemerstrand commented on September 27, 2024

This may be helpful: #61 (comment)

from python-gearman.

lidio601 avatar lidio601 commented on September 27, 2024

Ok, if I understood well it says to send the GEARMAN_COMMAND_GET_STATUS command that answers with a message like this:
{'known': '1', 'numerator': '0', 'running': '1', 'denominator': '0', 'job_handle': 'H:lab-vm12:2266'}
But it only says if there is a job running, and after the worker has finished it turns to:
{'known': '0', 'numerator': '0', 'running': '0', 'denominator': '0', 'job_handle': 'H:lab-vm12:2266'}
So I cannot reach the resulting data.
Is there a command such as "GEARMAN_COMMAND_GET_WORKING_DATA" that I can send to the gearman server to obtain the job result?

from python-gearman.

niklasfemerstrand avatar niklasfemerstrand commented on September 27, 2024

@lidio601

The easiest way to handle this with background jobs is to use job_handle as a key in an alternative storage engine and then looking the data up there if known==0, running==0 and you're sure that the job has existed (use job_handle for that).

Unfortunately GET_STATUS responses will say known==0 && running==0 for both jobs that have finished and jobs that never existed in the first place. This goes beyond the use case of Gearman, use alternative storage in your application to keep track of it and populate the key there (job_handle) with the status msgs that you want to access later.

from python-gearman.

niklasfemerstrand avatar niklasfemerstrand commented on September 27, 2024

@lidio601

WORK_STATUS is only for non-background jobs. With background jobs you have to substitute Gearman's WORK_STATUS. I think the Gearman daemon even drops the status of background jobs entirely once executed.

from python-gearman.

Related Issues (20)

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.