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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:48:39+00:00 2026-06-01T18:48:39+00:00

I’m a PHP web application developer that has built several large projects in PHP

  • 0

I’m a PHP web application developer that has built several large projects in PHP w/ CodeIgniter. PHP has always gotten the job done, but now I’m working on a new project that I’m building with the javascript extjs4 framework on the client-side. And I have some questions for experienced nodejs developers.

In my most recent PHP project, a user-login request required my server to make an API call to Facebook. The way I handled this, to improve scalability, was my client would make the initial login request, the server would pass the request to a ‘gearman’ job queing server, and a background worker process would grab the job and perform the API call. In the meantime, the server would reply to the client and then the client’s browser would start polling the server with AJAX to see if the job had completed. (Oh, and I passed the results of the Facebook API call from the worker to the application server with memcached). I did this to free up my application servers to handle more concurrent requests from users since PHP is locking and a Facebook API call takes several seconds.

My question is, does this whole model of App servers, a gearman job queing server, and background workers make sense for nodejs development since nodejs is non-locking? Would I simply accept an ajax request from the client to login, call the facebook API from the application server and wait for it’s response (while handling other user’s requests since nodejs is non-locking) and then reply to the user?

I’m also considering getting into nodejs development for the sake of being able to take advantage of the awesome heroku environment.

  • 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-01T18:48:40+00:00Added an answer on June 1, 2026 at 6:48 pm

    The short answer is yes, the way you would typically handle this in a node system is exactly how you describe it.

    Because node is non-blocking, the event-loop is constantly on the lookout for actionable requests. Here’s an example using node-facebook-client (one of many npm modules built to be used with facebook APIs)

      console.log('start');
    
      client.graphCall(path, params, method)(function(result) {
        // fires whenever request is completed
        console.log('facebook returned');
      });
    
      console.log('end');
    

    Outputs

      start
      end
      facebook returned
    

    As you can imagine, this is basically what all the fuss is about with node (plus it’s really really fast). That said, it’s also where the learning-curve is with node — asyncronous execution. If ‘end’ needs to come after ‘facebook returns’, then you’d have to put it in the callback

      console.log('start');
    
      client.graphCall(path, params, method)(function(result) {
        // fires whenever request is completed
        console.log('facebook returned');
        console.log('end');
      });
    

    Additionally, it’s elementary to integrate dynamic child processes into your application when it is needed, including additional node processes. From the official docs for child_process.fork:

    var cp = require('child_process');
    
    var n = cp.fork(__dirname + '/sub.js');
    
    n.on('message', function(m) {
      console.log('PARENT got message:', m);
    });
    
    n.send({ hello: 'world' });
    

    And then the child script, ‘sub.js’ might look like this:

     process.on('message', function(m) {
       console.log('CHILD got message:', m);
     });
    
     process.send({ foo: 'bar' });
    

    In the child the process object will have a send() method, and process will emit objects each time it receives a message on its channel.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm trying to create an if statement in PHP that prevents a single post
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,

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.