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 9134269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:37:48+00:00 2026-06-17T08:37:48+00:00

I have a very limited knowledge about node and nob-blocking IO so forgive me

  • 0

I have a very limited knowledge about node and nob-blocking IO so forgive me if my question is too naive.

In order to return needed information in response body, I need to

  • Make a call to 3rd party API
  • Wait for response
  • Add some modifications and return JSON response with the information I got from API.

My question is.. how can I wait for response? Or is it possible to send the information to the client only when I received response from API (as far as I know, connection should be bidirectional in this case which means I won’t be able to do so using HTTP).

And yet another question. If one request waits for response from API, does this mean than other users will be forced to wait too (since node is single-threaded) until I increase numbers of threads/processes from 1 to N?

  • 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-17T08:37:49+00:00Added an answer on June 17, 2026 at 8:37 am

    You pass a callback to the function which calls the service. If the service is a database, for example:

    db.connect(host, callback);
    

    And somewhere else in the code:

    var callback = function(err, dbObject) {
        // The connection was made, it's safe to handle the code here
        console.log(dbObject.status);
        res.json(jsonObject, 200)
    };
    

    Or you can use anonymous functions, so:

    db.connect(host, function(err, dbObject) {
        // The connection was made, it's safe to handle the code here
        console.log(dbObject.status);
        res.json(jsonObject, 200)
    });
    

    Between the call and the callback, node handles other clients / connections freely, “non-blocking”.

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

Sidebar

Related Questions

I have a questions here about MySQL replication. I have a very limited knowledge
I have very limited knowledge with scripts so I hope you guys can help
I have very limited knowledge of C#. My goal is to provide a C++
I'm very new to this and have limited knowledge (all self taught over the
I have very limited coding knowledge of OpenGL/Glut. I'm supposed to build house and
I'm unfamiliar with asyncore , and have very limited knowledge of asynchronous programming except
I have a very limited knowledge on AS400 and RPG. But we have a
I have very limited knowledge of using C Builder, could you give me an
I recently pickup Java so I have very limited knowledge, but I would like
I have very limited knowledge of PHP so I used a contact form generator,

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.