You are here: Re: How to send data a little at a time? « PHP Programming Language « IT news, forums, messages
Re: How to send data a little at a time?

Posted by Ivαn Sαnchez Ortega on 10/18/05 11:01

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mike Willbanks wrote:

>> I have a script that makes multiple requests to several sites.[...]
>> How do I get it to send some data at a time?
[...]
> 1) Create an image that tells them [...]
> 2) The AJAX way[...]
> 3) The harder way (requires some research)

4) The threaded way

Use pcntl_fork() to create a child process (or, if posible, a thread) for
each site request. As all the children share the same stdout file
descriptor, you should be able to echo() text to the browser asyncronously
(or, you could use popen() or some other pipe mechanism to centrlize the
output).
However, this approach has the disadvantage of potentially becoming a
concurrency hell. Make sure you have the proper inter-locking mechanisms to
access the shared resources (in this case, stdout).

- --
- ----------------------------------
IvΓ‘n SΓ‘nchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

Un ordenador no es un televisor ni un microondas, es una herramienta
compleja.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDVKvN3jcQ2mg3Pc8RAsloAJ0Rpdq0Z9erPIYXC1W/1dDxrg6ioACfed+x
qXepWc2RlJu2XXfO1Gx16Dw=
=Ts+N
-----END PGP SIGNATURE-----

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация