osbrain icon indicating copy to clipboard operation
osbrain copied to clipboard

Add `repeat` parameter in SYNC_PUB patterns

Open Peque opened this issue 9 years ago • 3 comments

When using those patterns maybe it is interesting to repeat the request after the wait is exhausted for a number of times before executing the error handler.

Peque avatar Mar 23 '17 15:03 Peque

I see what you mean, but this kinda defeats the purpose of having a "maximum wait", doesn't it?

I mean, if you set wait to a number of seconds, you expect the function to return after that time has elapsed. If you wanted to wait for a longer period, you could just set wait to a higher number and be done with it, don't you think?

The way I see it, send(..., wait=1, repeat=3) should be the same as send(..., wait=3).

ocaballeror avatar Apr 02 '18 15:04 ocaballeror

@ocaballeror Yeah, it is very similar, but when using PUB-SUB and under some circumstances we could be losing a message (think about distributed systems were losing connection temporarily is something to be expected from time to time).

So yeah, as you say it is the same, although with repeat we would be retrying the same request a couple of times before giving up.

Peque avatar Apr 02 '18 16:04 Peque

@ocaballeror BTW, I agree with you, this is not a critical feature. Maybe we could concentrate for now on other 0.7.0 issues and later decide whether or not we should include this in 0.7.0, a later release, or never.

Peque avatar Apr 02 '18 16:04 Peque