FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to post data without waiting for the response
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How to post data without waiting for the response [message #170365 is a reply to message #170341] Sat, 30 October 2010 15:55 Go to previous message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma:
Senior Member
On Fri, 29 Oct 2010 10:16:45 -0700 (PDT), bingomanatee wrote:
> I have a lot of data to transmit - a lot of multi-K files that I want
> to send to a web service. I want to do so WITHOUT waiting for the
> response. BTW using a simple url, sending a raw body POST.
>
> What is the best way to send the files that is no blocking (because
> not dependent on feedback from the recipient)?
>
> Recommendations?

You're going to have to wait for a response doing this. That's just how
http works. Request->Response. However...

If you're willing to take a little risk that the files are somehow wrong
and don't need to tell the user this immediately, you can make the wait
for response be very short. That is, may the php program that handles
the request (accepts the files), save them, and then fork off a new
process to actually do something to them. The child process, however
cannot ever communicate back to the user directly -- it'll have to
notify them by other means, like email. See

http://www.php.net/manual/en/pcntl.example.php

for how to start a process that detaches itself from the parent.

--
80. If my weakest troops fail to eliminate a hero, I will send out my
best troops instead of wasting time with progressively stronger
ones as he gets closer and closer to my fortress.
--Peter Anspach's list of things to do as an Evil Overlord
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Displaying RSS Feeds With Javascript2 ...
Next Topic: linking between 2 databases (on different servers)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 10:32:09 GMT 2024

Total time taken to generate the page: 0.05000 seconds