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