473,320 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

php asynchronous call and getting response from the background job

Hello,

I have done some google search on this topic and couldn't find the answer to my question.

What I want to achieve is the following:
1. the client make an asynchronous call to a function in the server
2. the server runs that function in the background, and the client is not hanging in the meantime
3. the client constantly make a call to the server requesting the status of the background job

Can you please give me some advices on resolving my issue?

Thank you very much! ^-^
Jan 29 '10 #1
5 6008
dgreenhouse
250 Expert 100+
Here's a quick first stab at some concepts...
There are no sequence numbers, there's little supporting description, and it's a bit dense, but the general idea can be groked - I hope.


By dgreenhouse at 2010-01-29
Jan 29 '10 #2
kovik
1,044 Expert 1GB
AFAIK, this is not something that PHP is capable of. AJAX can do this and your server can do this, but PHP cannot.
Jan 29 '10 #3
dgreenhouse
250 Expert 100+
I'm assuming that the frontend and backend process controllers are based on PHP. In that part of the design, PHP is more than adequate to meet the requirements.
Jan 29 '10 #4
kovik
1,044 Expert 1GB
PHP scripts can serve as the background process. However, PHP cannot start an asynchronous process.
Jan 29 '10 #5
dgreenhouse
250 Expert 100+
Yep... I know...

The async starts with the Ajax on the client end and is picked up by the frontend controller. The frontend controller schedules the job or spawns a backend process immediately to handle it. The backend process (as alluded to) can be invoked via cron although the minimum interval is limited to 1 minute.

Regardless, if this is in a shared hosting environment, there may be policies in place that terminate jobs (cli or not) running for more than x minutes. If that's the case, some type of job restart mechanism has to be designed (i.e. tracking script execution time, store temporary results, exit elegantly in prep for restart before the O.S. or other process kills the job in process.) [Of course Apache and IIS have timeout functions that might come into play depending on how the jobs are run.]

I've got some async stuff working for inter-server process communications which is a combination of PHP, .NET, WSDL, MySQL, MSSQL, (nix) cron jobs, and (windows) task scheduler jobs.

~~~ On another note... ~~~

Although this is somewhat Zend Framework specific, here's some interesting reading:
The Mysteries Of Asynchronous Processing With PHP - Part 1:...
The Mysteries Of Asynchronous Processing With PHP - Part 2:...
The Mysteries Of Asynchronous Processing With PHP - Part 3:...
Jan 29 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Matthew Groch | last post by:
Hi all, I've got a server that handles a relatively high number of concurrent transactions (on the magnitude of 1000's per second). Client applications establish socket connections with the...
1
by: Natalia DeBow | last post by:
Hi, I am working on a Windows-based client-server application. I am involved in the development of the remote client modules. I am using asynchronous delegates to obtain information from...
3
by: Grigs | last post by:
Hello, I have an ASP.Net webform that shows numerous attributes of parts we sell. There is one portion of the form that I have the user click a button to get the information for. I did this for...
3
by: usenetaccount | last post by:
In a newly created test app, to maximize client performance I tried to make two SOAP method calls in tandem (the soap methods execute some specified query), as each call includes a large amount of...
2
by: Gerda | last post by:
Hi! I've implemented many times an asynchronous call of a method with a call backfunction successfully. But to implement this with VB.NET is not so successfully. I can implement all events...
5
by: Stephen Barrett | last post by:
I have read many threads related to async fire and forget type calls, but none have addressed my particular problem. I have a webpage that instantiates a BL object and makes a method call. The...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
8
by: Simon Gorski | last post by:
I have a large problem, and I believe there is not yet a way to solve this using IIS and ASP.NET. I hope someone has a solution which we couldn't find. The current situation When a user logs...
1
by: jan.loucka | last post by:
I'm developing WinForms application in .NET 2.0 that talks to web service. The automatically generated proxy (reference class) has got methods for both synchronous and asynchronous invocations of...
1
by: jan.loucka | last post by:
I'm developing WinForms application in .NET 2.0 that talks to web service. The automatically generated proxy (reference class) has got methods for both synchronous and asynchronous invocations of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.