Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A facebook-like-notification system in php

How can I put in place a facebook-like-notification system: - A userA writes a message to the userB - A listener on the database routes the message to the userB - On the userB interface, the message appears instantly

How can I do that in php?

Thank you very much,

Regards

like image 582
Zakaria Avatar asked Aug 30 '10 21:08

Zakaria


1 Answers

I wouldn't advise using either polling or trying to implement a push based solution using PHP, if you are going to have any sizable traffic. What happens is that eventually all the PHP processes get blocked, and then you can't serve anymore web requests.

Look into node.js, cometd or another push based solution. If you need something simple and need to get up and running quickly, I'd recommend http://pusherapp.com/. They have a PHP client available and super simple API.

like image 190
Johnathan Leppert Avatar answered Oct 03 '22 08:10

Johnathan Leppert