A lot of things have been written about "real-time in web applications". But I want it somehow easier :) There is an option to open a flash (client) -> php (server) socket. Then another problem arose, for example, there will be a banal chat, and it will be necessary to write to the socket only if a new record appears in the database, but how to find out? Endless cycle? - No, not rolling. I found out only about triggers, but as I understood, by activating a trigger, you can do something only within the database. In short, how to be that? Maybe server-side JavaScript can do something?
- And what DBMS? In MSSQL for example, it is possible to fasten a stored procedure to a trigger, and from it, for example, to throw a request for which thread a web service. In MySql I don’t know for sure, but in recent versions I think something like this should be, I can clarify if you are interested. - invincible
|
1 answer
I advise you to pay attention to Node.JS, here is a great detailed answer on this topic. But I’ll warn you right away that it’s unlikely to write a full-fledged server framework
UPD : there are some crutches for MySQL. But I would not recommend using such a scheme, the DBMS should work with data, and not know anything about external software. Therefore, it would be more appropriate to use sockets in this case. You will have listeners on clients and on the server, and when some of the clients perform an action (add messages to the database), the server will be able to notify others about this change, and no endless cycles.
|