(Migrated) Invoke timeout

(This message has been automatically imported from the retired mailing list)

Hi,

Is it possible to define a timeout at the time of invoking another
service in a sync way?
I haven’t seen such an option in the docs, so I guess that it is not.

In that case, what do you think about making it possible? Would it be
something complex to achieve?

Regards,
Carles

On 06/11/2014 06:31 PM, Coeuz wrote:

Is it possible to define a timeout at the time of invoking another
service in a sync way?
I haven’t seen such an option in the docs, so I guess that it is not.

In that case, what do you think about making it possible? Would it be
something complex to achieve?

I’ve got this project bookmarked

https://github.com/bhearsum/redo

and I’m planning to make use of it so that one should be able to do:

self.invoke(‘foo’, retries=5, timeout=4.0)

However, it’s done yet - perhaps you could have a look at it and start
using it manually? As in wrapping a call to self.invoke in a function
using the redo package? Would be cool to get your feedback and find out
if this package is something we need.

thanks,

In that case it would mean starting a monitor greenlet that would start
a target greenlet calling self.invoke.

If monitor notices target doesn’t reply in N seconds, it returns an
error to the caller. Yup, that would work.

By the way, here’s a source of inspiration for that sort of spawning and
linking of greenlets:

https://zato.io/blog/posts/invoke-retry-in-zato-11.html

https://github.com/zatosource/zato-labs/blob/master/invoke_retry/code/src/zato/invoke_retry/init.py