So, RQ explicitly states I can enqueue an instance method of an object here, so I've been trying to do that, but getting a PicklingError
:
q.enqueue(some_obj.some_func, some_data)
*** PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.function failed
Really, I just need access to a SQL connection in my method, so I tried just making it a function that takes the SQL connection explicitly. That fails too:
q.enqueue(some_func, sql_sess, some_data)
*** PicklingError: Can't pickle <class 'sqlalchemy.orm.session.Session'>: it's not the same object as sqlalchemy.orm.session.Session
How do I get around this? Am I doing something wrong, or is the library just broken?