nvie/rq — pull request #462 by conslo (2014-12-08 23:28:33+00:00)
Title: Worker hash

In trying to implement something that I later found a better way of doing, I discovered that `Queue` and `Job` both implement what's necessary for uniqueness in sets (that is: `.__hash__()` and `.__eq__()`); but `Worker` does not.

Since workers are already unique per-name per-database (please correct me if I'm wrong; this is from observing when I tried to create two workers with the same name), and the implementations in both `Queue` and `Job` don't take the database/connection into account, I implemented this using the `.name` attribute of `Worker`.

This would be useful when getting lists of workers from the rq (ie: `Worker.all(conn)`) and doing some internal organization/categorization of them; tracking changes in the worker list (without needing to use `worker.name` everywhere), etc.

Test included! :D