문제

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?

도움이 되었습니까?

해결책

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top