Question

I'm working on a distributed job execution system with gearman (perl extension). When the work retrieves a foreground job, I hope the client could get the hostname of the worker's machine, which requires a methodology sending message from worker to client. I think it's possible because we already have Gearman::Job->set_status method, which however could only deal with numerical values. I did some research and found this, but it's for Gearman PHP extensions. Do we have some similar method for Perl?

Was it helpful?

Solution

At last I found that even thought we don't get a send_data in Gearman::Worker package on CPAN, there exists another package Gearman::XS::Worker which provides this function, and will do the trick.

EDIT: I tried Gearman::XS::Worker but it seems some methods don't work with my Gearman 0.33. So I went back to Gearman::Worker, and added send_data method to this package according to gearman's protocol, you can clone it here (clone the repo and override the Gearman directory).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top