项目作者: gisce

项目描述 :
OpenObject Redis Queue
高级语言: Python
项目地址: git://github.com/gisce/oorq.git
创建时间: 2013-04-21T19:37:30Z
项目社区:https://github.com/gisce/oorq

开源协议:

下载


RQ for OpenObject

Using python-rq for OpenObject tasks.

API compatibility

  • For OpenERP v5 the module versions are v1.X.X or below and branch is api_v5 Build Status
  • For OpenERP v6 the module versions are v2.X.X and branch is api_v6 Build Status
  • For OpenERP v7 the module versions are v3.X.X and branch is api_v7 Build Status

DB compatibility (Tested)

  • Redis (3, 5, 7, 8M)
  • Valkey (8)

Example to do a async write.

Add the decorator to the function

  1. from osv import osv
  2. from oorq.decorators import job
  3. class ResPartner(osv.osv):
  4. _name = 'res.partner'
  5. _inherit = 'res.partner'
  6. @job(async=True)
  7. def write(self, cursor, user, ids, vals, context=None):
  8. res = super(ResPartner,
  9. self).write(cursor, user, ids, vals, context)
  10. return res
  11. ResPartner()

Start the worker

  1. $ PYTHONPATH=~/Projects/OpenERP/server/bin:~/Projects/OpenERP/server/bin/addons rq worker

Do fun things :)