开发者

Sending post request and do not wait for reply and continue php script

开发者 https://www.devze.com 2023-02-10 11:31 出处:网络
I need to send post request from php whithout waiting for response . CURL has no this abilli开发者_如何学运维ty and also wget.

I need to send post request from php whithout waiting for response .

CURL has no this abilli开发者_如何学运维ty and also wget.

I am sending many post requests to apple push servers and reply from this server is very slow and i dont need the response.

thx for help


From the wget man page:

-b

--background

Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


Take a look at this question. It has a code sample for what you want.


Put the requests into a queue (a database perhaps), and have a separate script which runs periodically and executes requests from the queue.


You could try setting CURLOPT_TIMEOUT. That wac curl_exec() will stop if it takes too long.

0

精彩评论

暂无评论...
验证码 换一张
取 消