How might they do it?

Discussion in 'Programming' started by Triexa, Oct 6, 2006.

  1. #1
    I was taking a look through CampFire (http://www.campfirenow.com). (If you don't know if it, just use an ajax "shoutfox" for reference I guess)

    The system polls the server every 3 seconds for new messages/events/etc.

    Unless I'm totally out of it, my thoughts are that each poll results in queries:
    - Check for latest messages
    - Check for members in room

    That would mean 2 queries for each of the above every 3 seconds. Surely that isn't the way it's done though, as I would think that would create massively unnecessary serverload.

    Any ideas how to more efficiently accomplish such a task?
     
    Triexa, Oct 6, 2006 IP
  2. faraday911

    faraday911 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    One way out is - when a reply is posted, some fields in the DB are altered and get the value, say, "room1=message_text, member_id=123"

    the shoutbox script just looks at these fields, outputs them to the shoutbox and clears the fields
     
    faraday911, Oct 7, 2006 IP