DDP call timeout


Is it possible to make calls timeout?

I have a server to server connection.
It is expected that the client will call method A on server 1 which will make a call to server 2 in order to satisfy method A.
In the case where server 2 becomes unavailable, (using synchronous calls) method A never returns and the calls to server 2 get queued up until reconnect.
At reconnect, all the calls to server 2 are made and method A is satisfied.

After a long disconnect, it is not always appropriate to make those calls to server 2.
In this case it would be better if the pending calls to server 2 timed out and an error response is returned to the client.

Is there a way to do this with meteor / DDP?


This feature didn’t quite get the spotlight it deserved in the Meteor 1.3.3 release, but you can now add a noRetry flag when using Meteor.apply (which is just like Meteor.call with a few tweaks). Maybe that can help?


@gegenki Did you find any solution? Or anyone else? I’m looking for the same.

noRetry on Meteor.apply doesn’t quite solve the issue. I DO want the method to retry, but only for a certain amount of time.

The only way I see right now would be a manual process by checking the connection status and only call the method if the status is “connected” or cancel after several seconds.