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

  • SEARCH
  • Home
  • 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 4027388
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:05:26+00:00 2026-05-20T11:05:26+00:00

I have programed for my application to make a call to an external rest

  • 0

I have programed for my application to make a call to an external rest service when a user makes a request. This allows me to get the data to serve there request. The service has requested that I limit the concurrent connections. How would I setup something like a resource pool in PHP to limit the concurrent calls?

  • 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-05-20T11:05:27+00:00Added an answer on May 20, 2026 at 11:05 am

    And here goes one of the most annoying “features” of PHP – no application scope. Scripts are executed over and over again for each request without any chance of further management.

    But to stop complaining and start being helpful: Use UNIX file locks. If you are limited to 5 concurrent connections to the external resource, create 5 empty files. Whenever you want to use them, try to acquire an exclusive lock on one of them (flock() function). If you can’t, the current “script instance/thread” has to wait until the lock is released.

    This is not really nice, but it’s perfectly thread-safe as flock is atomic. I have my own wrapper for handling these “critical sections” which require so called thread lockout. The obvious downside of this approach is performance overhead and inability to launch multiple app servers without shared FS (then we do it either by shared FS or shared memchache space).

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

Sidebar

Related Questions

I have a table like this: Application,Program,UsedObject It can have data like this: A,P1,ZZ
We have code to log data in our Ruby 1.8.6 web application. You call
I make an application which has to store a lot of data in memory
Lets suppose I have an .NET client application that connects to a WCF service,
I am making an application that creates and allows the user to edit an
Overview: I have an application that sometimes must make something with celery- and if
I have data in an Excel spreadsheet with values like this: 0.69491375 0.31220394 The
I have recently programmed a console application and I've experienced a lot of pain
I have multiple IPs on a NIC. I've programmed a console application to connect
I have an update program that is completely independent of my main application. I

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.