/    Sign up×
Community /Pin to ProfileBookmark

async in php

I have such a case that, in a PHP/MySQL/Apache setup, the users will submit requests for some time-taking database processing but they don’t want to wait for the result (they can check back later).

How can I return to the users with some message and release their http connection so that they don’t need to wait, but at the same time, proceed to the database processing asynchronously?

I was thinking of using register_shutdown_function for the database part, but later I found someone comments that (last comment on [url]http://www.php.net/manual/en/function.register-shutdown-function.php[/url]), if running Apache/Win, the http connection will stay until the register_shutdown_function completes all the task.

Any solution or advice?

Thanks,
Xin

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Xin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.12,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...