Hi,
I'm trying to implement chat application with ActionScript (Flash)
frontend and GAP back-end. Currently I've run it with following code:
class Message(db.Model):
timestamp = db.FloatProperty(required=True)
text = db.StringProperty(required=True)
class Chat(webapp.RequestHandler):
def get(self):
if self.request.get('since'):
since = float(self.request.get('since'))
messages = Message.gql('WHERE timestamp > :1 ORDER BY
timestamp DESC', since)
else:
messages = Message.gql('ORDER BY timestamp DESC LIMIT ' +
str(self.request.get('last_num', 64)))
since = -1
# render here ...
def post(self):
msg = Message(
timestamp = time.time(),
text = self.request.get('text'))
msg.put()
# render here ...
It's work pretty well, but sometimes post or get requests are take
much time (more than 10s) and GAP droped them. It's happened pretty
rare (less then 1 per 10.000 get requests, and 1 per 500 post
requests) and I have alert for user in Flash part for this situation
(IOError). But anyway...It's better when all worked clean and without
any errors. Is it any posible better solutions for my project?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---