retries
and timeouts
misunderstanding? bug? or conspiracy?
#16
Labels
retries
and timeouts
misunderstanding? bug? or conspiracy?
#16
The Problem:
I'm attempting to use asynchronous callbacks with a pmrpc call. It would seem that the call is timing out with not enough retries to get my
onSuccess
callback to be called.So, to test this hypothesis, in my project I, exaggerated the delay by using a
setTimeout
which seemed to cause the same problem consistently. I've replicated this scenario accurately in the demo below.I attempted to increase the number of
retries
first instead of the timeout because I don't want to increase the delay of the callback if I can help it - calling-back sooner is better than later; however, increasing theretries
from it's default value doesn't seem to yield any different result.Finally, I increased the
timeout
to something larger than the delay and myonSucces
got called butonError
was also being called 3 times after (with two different messages).Questions
onError
function I observe only 4onError
calls (when the default is 5retries
). Why? Is there something else going on here?timeout
is 1000ms and the delay before callback is 3000ms then why does theonSuccess
not get fired on the 4th or 5th retry?onError
is still being called. Why? Again, is there something else going on here?onError
calls there is always 1 with messageMethod not found. The requestd remote procedure does not exist or is not available.
and 2 or 3 with messageApplication error. Destination unavailable.
What's up with that? (Also, not to be a dick, but there's a typo "... The requestd remote...")Steps to Replicate / Using the Demo:
The demo's JS has a
map
object containing 2 key/value pairs. The HTML has 2 buttons. The pmrpc procedure/call pair are set up so that clicking a button in the "child" (iframe) will call the "parent" pmrpc procedure and callback with the respectivemap
value.onError
calls and noonSuccess
calls.retries
to15
. This results will be the same.timeout
to3500
. This will allow the callback to call and will also callonError
3 times.Demo:
jsfiddle: "Parent" document example
gist "Child" document (iframe source)
Note: I'm currently hosting the iframe document (I didn't know where else to put it for working jsfiddle example)
The text was updated successfully, but these errors were encountered: