Best approach for (cross-platform) real-time data streaming in PHP?

后端 未结 3 1364
闹比i
闹比i 2020-12-16 05:37

I\'ve been wondering how to do \"true\" (semi) real-time data streaming with PHP.

Possible applications: chat rooms, auctions, games, etc.

By \"true\", I mea

3条回答
  •  春和景丽
    2020-12-16 06:18

    If you want to communicate between PHP and another language (for instance a C++ application) you might want to look into Apache Thrift (http://thrift.apache.org/). Apache Thrift is widely used at Facebook for "scalable cross-language services development".

    Edit: I would probably use Apache Thrift to communicate with a Twisted application listening on port 80 and have the browsers connect to the Twisted application using either long polling or a websocket. You might want to also look into Socket.IO, it's a cross-browser web socket implementation which is made for realtime applications.

    Basically you would have your application push to your Twisted web server using Thrift and you would then pass the message to any open connections.

    • Christian

提交回复
热议问题