nvie/rq — pull request #90 by omarkhan (2012-07-17 11:00:37+00:00)
Title: Allow instance methods to be enqueued

I have made a minor modification to the `Job` class to allow instance methods to be enqueued. This works by pickling the instance itself alongside the method name and adding it to the job's `job_tuple`. This now works:

```python
import time

class PingPong(object):
def __init__(self, delay):
self.delay = delay

def ping(self):
time.sleep(self.delay)
return 'PONG'

obj = PingPong(5)
q.enqueue(obj.ping)
```

Naturally the instance must be picklable for this to work. Tests included.