note 56602 deleted from function.flock by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 May 2009 00:42:49 +0000 |
| Subject: | note 56602 deleted from function.flock by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155414@lists.php.net to get a copy of this message | ||
Note Submitter: vlad at NOTNEEDED easysoft dot ee
----
I was searching for the idea to get flock() to work without data loss, and unfortunately all i read
here was not helpful to me, after some hard testing i still get some data lost or corrupted.
So my suggestion is how to make a really data safe mechanism is to organize something like simple
multithreaded queue daemon, that will listen for connections and wait for data to be sent and push
it to some queue. Then process data from the queue and store it to file/sql or whatever we need.
Another words: we get data queued and then processed and stored without any flock(); Also this gives
us possibility to have centralized data sysytem (in case we need to collect data from different
remote servers).
Sure this will be not so easy as flock(), so people who count on proffessionalism and not luck, may
find this helpful.
Thnx.