Nasıl bir gerçek zamanlı istatistikler sistemi yazabilirim?

1 Cevap php

I trying to make a realtime stats bar. And I think of using the Long Polling concept.

But when a request is send to php. I need a way of testing if the stats are updated.

Now I can just make a loop with a database query, and test it. But that just doesn't seem right to me :)

Güncellemeleri için veritabanı test daha ucuz bir yöntem var mı?

1 Cevap

Bu istatistikler güncel olup olmadığını belirlemek için sorgu nasıl yoğun bağlıdır. Basit (ve hızlı) sorgu ise, o zaman en iyi seçenek olacaktır. Pahalı bir sorgu ise, bir datestamp ayarlamak veya bir DB tetikleyici sizin için bunu yapmak zorunda ya da öylesine istatistikler güncellenmektedir nasıl değiştirebilir. Ne olursa olsun, güncelleştirmeleri kontrol etmek için some type sorgu ihtiyacımız olacak.

Ve ne olursa olsun müşteri çeki başlatır böylece ajax Oylamayı ne gerekir ya sunucudan istemciye "push", bu yüzden yapamam ....