Prevent multi calling Meteor.call

Dear members,

I need a advise about to prevent to call methods for clients:

More specificly I have got a third REST server and my meteor clients connecting as meteor client on Meteor.call like as

Meteor.call('get_from_another_rest_server', arg1, arg2, function(error, result) {
    console.log(result);
});

My rest client working in the meteor’s server side.

But my 3rd server is not answering quickly I can get the answer 10~20 sec later.
If user send to a lot of request to my 3rd server means there are a lot of waiting for same question.
I would like to push to a queue system my request and if this message not finished I would deny to new attemps.

Ofcourse I can create a queue array and manage by myself but I would like to use ready to use (or to configurable) plugin or library so is there any plugin or method for this kind operations?

Best regards

I can’t think of a package off the top of my head that does exactly what you want.

However, this sounds like something where a little bit of caching would help a lot, depending on how you’re using this 3rd service:
Are you posting to or fetching data from this rest service?

If fetching, does the data change for each user?
if not, then you can save the response and only re-check every few minutes.

If you’re posting, does the client need the response, or can you “fire and forget”?
If you can “fire and forget”, you could queue it up and deal with them as time allows

If you provide a little more information about your problem, we might be able to provide more structural advice, rather than just a package recommendation