← Back to team overview

openerp-connector-community team mailing list archive

Re: Is synchronous communication possible ?

 

On 02/19/2014 11:06 AM, Lionel Sausin wrote:
Dear Openerp Connector community,

We need to send records from OpenERP to several third-party proprietary
applications, and as we migrate to v7 I'd like to re-factor around
OpenERP connector.

Would OpenERP connector be able to handle "synchronous" communication?
Basically, throwing jobs at the backend without queuing them. I'd still
benefit from the backend part of the framework.

The reason I ask is, for some of the 3rd party apps, I'd like to
rollback in OpenERP when they fail to commit the new records. For this,
I suppose we need to make it a synchronous call from the OpenERP model's
method.


Lionel Sausin.



Totally possible.

The connector is composed of many pieces, as a developer you do what you want and can use a piece or another but not all of them if you want.

A job is a simple function decorated with @job [0]
Calling .delay() on a decorated function will push it as a job in the queue. But calling the function directly will execute it synchronously, because it's still a normal function. It means that changing a @job function to be executed synchronously or asynchronously is a 8 chars change.

[0] http://openerp-connector.com/api/api_queue.html#connector.queue.job.job


--
Guewen Baconnier
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 39
Office: +41 21 619 10 10
http://www.camptocamp.com/


Follow ups

References