I'm an old school object-oriented programmer that still uses inheritance, so I subclassed Gearman::Client to make my own client that provides default settings for my project. Unfortunately, there's a line in Taskset.pm (in both the master and ssl branches) that requires the client object to be a reference to a Gearman::Client object and nothing else.
I'm an old school object-oriented programmer that still uses inheritance, so I subclassed Gearman::Client to make my own client that provides default settings for my project. Unfortunately, there's a line in Taskset.pm (in both the master and ssl branches) that requires the client object to be a reference to a Gearman::Client object and nothing else.
The fix is rather simple, of course. I changed
ref($client) eq "Gearman::Client"
to
(Scalar::Util::blessed($client) && $client->isa("Gearman::Client"))
Once I made that change in Taskset.pm, my Client subclass worked fine.
There might be other cases of 'ref($object) eq "Gearman::whatever"' in the code, but I am mainly interested in subclassing Gearman::Client.