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 #170345 is a reply to message #170344] Fri, 29 October 2010 18:33 Go to previous messageGo to previous message
Magno is currently offline  Magno
Messages: 49
Registered: October 2010
Karma:
Member
On 10/29/2010 03:23 PM, The Natural Philosopher wrote:
> Magno wrote:
>> On 10/29/2010 02:30 PM, The Natural Philosopher wrote:
>>> 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?
>>>
>>> I dont really understand what you are trying to do here.
>>>
>>> Where is the PHP involved? On the web service server?
>>>
>>>
>>> PHP is not an environment that lends itself to background data
>>> transmission.
>>
>> I think the OP could be wanting to send info or files from within PHP
>> to another server through something like CURL?
>>
>> If this is the case... I think the best approach would be to launch
>> another process to do this, with exec() for example.
>
> If that is the case, then I totally agree.
>
> Could easily exec a background process to fork, handle the data
> transfer, and exit when done, silently.
>
> Of course it wouldn't give any guarantee that te data WAS sent.
>
> Or you could write a daemon, that simply looked in a temporary
> directory, and uploaded any files it found there.
>
> Or a process run under cron.
>
> That might be more reliable in fact,. because a failed transfer could be
> repeated.
>
> It's pretty much the way e.g. sendmail works.
>
> In fact you could probably use a mail system to do it: write a custom
> delivery agent and email the files..the delivery agent is invoked if a
> special mail address is noted, and does the dirty work. I used to know
> how to make sendmail do that.

Anyway, I want to add... in case that making a daemon is not possible. I
personally would make a database table to reflect how the work is going
on by process, which I can query later to know if everything went OK.
[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 11:42:04 GMT 2024

Total time taken to generate the page: 0.04163 seconds