Code Monkey home page Code Monkey logo

Comments (8)

muka avatar muka commented on June 2, 2024

Sorry,
I found this that is what I was looking for

$result = $gearman->doJob();
$status = $gearman->getJobStatus($result);

So, If I've understood correctly the event can be triggered only from the worker instance.

from gearmanbundle.

mmoreram avatar mmoreram commented on June 2, 2024

Hi!

Sorry but I am not sure about what you need.
Please, specify exactly what you need so we can find the best solution :)

from gearmanbundle.

muka avatar muka commented on June 2, 2024

Hi!
Thank you for the answer. I'm trying to get response data from a worker (a "reverse callback" I guess -as in php.net speaking-), specifically get a callback from the class instance where the gearman client is calling the worker.
Hope to have been clearer this time :)
I think this is a meaningful example:
http://php.net/manual/en/gearman.examples-reverse-task.php

Thanks

from gearmanbundle.

mmoreram avatar mmoreram commented on June 2, 2024

Have you taked a look at Bundle kernel events ?

from gearmanbundle.

muka avatar muka commented on June 2, 2024

Yes, but I was looking to use the service container to get an event_dispatcher to bind reversed gearman events directly to the instanced class methods. Something like this:

$dispatcher = $this->getContainer()->get('event_dispatcher');
$dispatcher->addListener("gearman.client.callback.status", array($this, 'onStatus'));

Is this correct / feasible ?

Thank you!

from gearmanbundle.

muka avatar muka commented on June 2, 2024

Sorry, I got it at the end...
I was using a Job instead of a Task. Works a expected, thank you

from gearmanbundle.

mmoreram avatar mmoreram commented on June 2, 2024

Oh, great :D Any bundle feedback? Is being useful?

from gearmanbundle.

muka avatar muka commented on June 2, 2024

I'm still at a initial stage but looks extremely interesting.. I'll do my best to report any further possible optimization

Great work!

from gearmanbundle.

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.