LOOP CHAT!

Send to friend

LOOP CHAT!

This is a dead simple proof of concept for a chat the comet way.

My motivation for creating this proof of concept is the lack of DEAD SIMPLE implementations of commet around.

  • It can run only on threaded mongrel
  • It uses an application level variable ($msg) as the "holder" of last message
  • Opens a connection to server (/love/getter) and holds it for 5 seconds or until $msg is modified -
  • then it refreshes the connection and adds the new msg (if there is such) to the thread
  • I used iframes instead of Ajax requests to make it even simpler to demonstrate the concept
  • For real world usage I would recommend using REDIS or FILES to storage the conversations,
  • and to use the mongrels application level variable to let the client know if it should AJAX for the new message from another ACTION
  • For the client side you should probably use some simple FLASH object to open the connection, to avoid the constant "loading..." message
  • ENJOY!

TAKE IT: http://github.com/dorkalev/loopchat