How are real time web applications achievable with PHP?
My answer to How are real time web applications achievable with PHP? on Quora
You don’t need to build your comet server using the same technology as the rest of your site.
I build apps in Django, which isn’t really suitable for comet due to its core expectation that an HTTP request/response cycle returns immediately rather than blocking. If I was building a comet application, I’d have the main site served by Django and then run a Node.js or Twisted or Tornado server on a separate subdomain (comet.example.com) and have my comet calls served by that.
Quora does something similar to this—if you run Firebug or similar you can see that Quora’s comet servers run on subdomains with names like tch972015.tch.www.quora.com. This also makes it easy to scale your comet stuff since you can just fire up more servers on more subdomains—you don’t even need to load balance them (though you probably should). I believe they use the same Python stack for Comet and the main site, but there’s no reason you have to.
More recent articles
- Weeknotes: Parquet in Datasette Lite, various talks, more LLM hacking - 4th June 2023
- It's infuriatingly hard to understand how closed models train on their input - 4th June 2023
- ChatGPT should include inline tips - 30th May 2023
- Lawyer cites fake cases invented by ChatGPT, judge is not amused - 27th May 2023
- llm, ttok and strip-tags - CLI tools for working with ChatGPT and other LLMs - 18th May 2023
- Delimiters won't save you from prompt injection - 11th May 2023
- Weeknotes: sqlite-utils 3.31, download-esm, Python in a sandbox - 10th May 2023
- Leaked Google document: "We Have No Moat, And Neither Does OpenAI" - 4th May 2023
- Midjourney 5.1 - 4th May 2023
- Prompt injection explained, with video, slides, and a transcript - 2nd May 2023