Open matslindh opened 13 years ago
I think requiring servers to have unique names is reasonable. More reasonable that limiting this to 1 connection. If you rewrite it to poll all servers and rely on them having unique hostnames, I'm ok with that just documenting that little detail. Another option is to take the connection as a argument, and poll all if it's None
, and if not, poll just that 1 connection.
Also, instead of directly instantiating GearmanJobRequest
, please use self.job_request_class
. That will be useful for those of us who mock all that stuff for unit-testing.
(Incidentally, the hostname is in the handle, but that won't necessarily match the client side hostname, so that can't be used.)
Added convenience function for retrieving the status of a task by just submitting the task handle.
To be able to query the correct server for the status, this requires the client to only have one added server.
Feel free to clean up the patch (I'm not happy about having to set CREATED as status, etc. It works, but there's probably better ways of achieving this).