Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8013441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:37:58+00:00 2026-06-04T19:37:58+00:00

I have a NodeJS app which sends HTTP get requests from various places in

  • 0

I have a NodeJS app which sends HTTP get requests from various places in the code, some are even dependent (sending a request, waiting for a reply, processing it and based on results sending another request).
I need to limit the rate the requests (e.g., 10 requests per hour).

I thought about queuing the requests and then at some central point releasing them in a controlled manner, but got stuck at how to queue the callback functions and their dependent parameters.

Would be happy to hear suggestions how to over come this scenario with minimum restructuring for the app.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:38:00+00:00Added an answer on June 4, 2026 at 7:38 pm

    I think that you have answered your question already. A central queue that can throttle your requests is the way to go. The only problem here is that the queue has to have the full information of for the request and the callback(s) that should be used. I would abstract this in a QueueableRequest object that could look something like this:

    var QueueableRequest = function(url, params, httpMethod, success, failure){
      this.url = url;
      this.params = params;
      ...
    
    }
    //Then you can queue your request with
    
    queue.add(new QueueableRequest({
      "api.test.com",
      {"test": 1},
      "GET",
      function(data){ console.log('success');},
      function(err){ console.log('error');}
    }));
    

    Of course this is just sample code that could be much prettier, but I hope you get the picture.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this NodeJS app which fetches JSON-type response from a web application and
I have the following node.js server-side code: var app = require('http').createServer(handler) , io =
I have a Rails app that sends requests to a Node.js app. The node.js
I have some non-standard XML from a legacy app: <PODRoot> <RowData> <PODItem>Item243</PODItem> <StoragePath>PODItem66</StoragePath> <ID>-13</ID>
I have recently been working on a nodejs app which uses open socket connections
I have the following express node.js app. It's using the 'redis' npm package. app.get(/test,function(req,res){
How to get the string length in bytes in nodejs? If I have a
I have some legacy scientific code running on a Rocks cluster, with SGE. I
I have a node.js app which routes events to a web page's shotbox which
I'm currently writing a client-side javascript app which performs image manipulation. Some of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.