On 2017-02-24 16:24, Vincent Bastos wrote:
> On Thu, Feb 23, 2017 at 7:45 PM, Cédric Krier <cedric.kr...@b2ck.com> wrote:
> 
> > On 2017-02-23 18:53, Vincent Bastos wrote:
> > > On Thu, Feb 23, 2017 at 6:39 PM, Cédric Krier <cedric.kr...@b2ck.com>
> > wrote:
> > > The way the Twilio API works is that you send it a request to send a
> > > message and it manages the queue. In effect, The queue is not in Tryton,
> > > but in Twilio, but Tryton has a record of what messages were sent to
> > Twilio.
> > >
> > > When you send a "request to send an sms" to Twilio it allows you to add a
> > > call back url that Twilio will call when the state of the message
> > changes.
> >
> > This will be doable if twilio support 2 phase commit and if it retries
> > the callback if they failed.
> > But I do not see a generic design here, at best a twilio module.
> >
> 
> Twilio just provides an HTTP restful API.
> 
> I was thinking of sending a request inside the create method and saving the
> record with a different value depending on whether the request was
> successful or not.

This is not transactionally safe.
At best it could be done like the sendmail_transactional which is ensure
the server is up on the vote and send on finish without raising any
exception. It is not perfect but it should work in the majority cases.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20170224094045.GH36856%40tetsuo.

Reply via email to