asenkron programlama
-
php ile nasıl yapılır diye düşünürken stackoverflowda mantıklı bir yolunu bulduğum programlama tarzıdır.
direkt alıntılıyorum;
you are not specifying what language the asynchronous call is in, but ı'm assuming php on both ends. ı think the most elegant way would be this:
html page loads, defines a random key for the operation (e.g. using rand() or an already available session ıd [be careful though that the same user could be starting two operations])
html page makes ajax call to php script to start_process.php
start_process.php executes exec /path/to/scriptname.php to start the process; see the user contributed notes on exec() on suggestions how to start a process in the background. which one is the right for you, depends mainly on your os.
long_process.php frequently writes its status into a status file, named after the random key that your ajax page generated
html page makes frequent calls to show_status.php that reads out the status file, and returns the progress.
ekşi sözlük kullanıcılarıyla mesajlaşmak ve yazdıkları entry'leri
takip etmek için giriş yapmalısın.
hesabın var mı? giriş yap