Tag Archives: ReactPHP

Using WebSocket with Drupal

Drupal TipsDrupal is written with PHP – a language that has quite a few limitations: request-response logic, one thread per request, no shared-in-memory variables between requests, among other strictures. PHP is easy and fine when you only need to render HTML pages, but what if you want to add real-time applications like chat, streaming analytics, or document collaboration? For these, a better approach is to use the WebSocket protocol. Languages like Java or C++ support this protocol in their core, but not PHP. If we want to develop real-time applications, can a Drupal website avoid writing some part with Java or C++ or using third-party products like Google Cloud Messaging (GCM)? The answer is yes.

Continue reading