Jonas, Good questions. So first off, everything in pybeanstalk is meant to be usable relatively independent of other parts. So no, if conn.job is not set, you will just get a dict back. That dict will contain some meta-data and the job data itself.
The reason you may want to set conn.job is: job.Job is meant to be subclassed, and the .run method implemented. This is from when I thought it would be a good idea to provide a simple consumer framework with pybeanstalk, but this path is mostly abandoned now, unless someone wants me to revive it. The other reason you may want to set conn.job is: conn.job can be any callable that takes **kwargs. This means you could set up very simple processing on a job by writing a clever conn.job function. (not reccomended, but doable). Also, I did notice one error that should be fixed soon on github: job should be an attribute of the ServerConn class, not the instance, so you should only need to set it once per runtime, not once per connection object. (Once again, this is flexible, due to the nature of objects in python...). HTH Regards, Erich On Dec 28, 6:22 pm, Jonas Galvez <[email protected]> wrote: > This is how I'm doing it: > > _QUEUE_CONN = serverconn.ServerConn('12.34.56.78', 11300) > _QUEUE_CONN.job = job.Job > > It's completely based on the examples provided. > > My question: do I really need to set conn.job? Why would I want to set > it to something else? > > --Jonas Galvez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "beanstalk-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/beanstalk-talk?hl=en -~----------~----~----~----~------~----~------~--~---
