tags:

views:

259

answers:

2

Hi,

I'm new to comet, but I have read about it and I realize that PHP is bad for comet long polling.

All of my project is written in CodeIgniter PHP Framework, so all my code is PHP. But I need request data all seconds to update auctions products, and I'm looking for comet, but as PHP is a bad way to comet, how can I do it?

also it is possible to read from MySQL and send to listener?

Thanks.

+1  A: 

One solution is Ajax Push Engine - they dish out their own server for handling the connections with clients, but you can use whatever backend to feed data to APE - including PHP. You can also work with MySQL directly - see example one and two. Note: the APE server can only be run on Linux, BSD or Mac OS X (though, it would seem that a port to Windows should be possible, since it's written in pure C, AFAICT).

The other one is NGiNX_HTTP_Push_Module - you use nginx as your push server (no need for an extra server running, like it's in APE's case) and the protocol is easy to work with/straightforward IMHO.

Igor Klimer
thanks, there are any APE working with windows? without virtual
sn4k3
:facepalm: Whoops, thanks for pointing that out, completely forgot about it - unfortunately APE is only for Linux, BSD or Mac OS X - I've edited my answer to include that.
Igor Klimer
can be written in pure C, but there are diferent usages in linux and windows, like threads and sockets definesthere are any other good solution?thanks
sn4k3
No, yeah, I understand that a simple recompile won't do it, just that it should be *possible* (ok, it's always possible :D). Anyway, the other option I could recommend is nginx and its push module. It's possible to run nginx on Windows (http://nginx.org/en/docs/windows.html) - for development purposes it should suffice. For a bigger list of other possibilities (including commercial) see http://ajaxpatterns.org/HTTP_Streaming
Igor Klimer
thanks, i will see what i can do
sn4k3
A: 

Another options would be a hosted comet SaaS solution, such as WebSync On-Demand. It's cheap, and because it's hosted doesn't have server requirements.

There's a PHP SDK for integrating your data push.

[Disclaimer: I work there]

jvenema