0

Currently im trouble shooting some code that I wrote to create a chat room. I will include the code if necessary but for now I just wanted to hear some possibilities for the problem im having. So basically I have client1 that is listening to a channel and then when clien2 sends a message to the server the message is then sent from the server to all available users. What is happening is that client 2 will send the message and it will be displayed on his browser but client 1 will not receive the message until he refreshes the page or types in a message of his own. So I would think that user presence is being detected fine since the message eventually gets sent to all available users but im not sure? Thoughts?

David
  • 75
  • 1
  • 2
  • 8

1 Answers1

2

The Google App Engine blog has a nice case study that talks about how to do this.

They store a list of channel ID's in memcache and send update messages to each of them. They mention that race conditions make memcache not ideal, but it worked well enough for their demo.

Jeff Tratner
  • 13,792
  • 4
  • 41
  • 63
jpl
  • 38
  • 1
  • 1
  • 6