Concurrent user updating stock with php
The user that Nextcloud uses to write to the database.
They’re similar to Web Sockets in that they happen in real time, but they’re very much a one-way communication method † Is it Server-Sent Events or Event Source? Server-Sent Events is the name of the API and specification.I’ve included all the files for this demo on Git Hub for you to peruse at your own leisure, and I’ve also deployed a live example of this code.Ideally, you should use a server that has an event loop. This works nearly all the time, but in writing this article, I found a few edge cases where it doesn’t fire.In Chrome, if I put my machine to sleep and then woke it back up, it would close the connection but not fire the event, therefore never triggering a reconnection.As I said, this is an edge case and I’ll file a bug against it, so I don’t expect it to hang around for long.