Is long polling possible in Google App Engine?

后端 未结 3 1816
面向向阳花
面向向阳花 2020-12-31 17:49

I need to make application that needs to poll server often, but GAE has limitations on requests, so making a lot of requests could be very costly. Is it possible to use long

3条回答
  •  春和景丽
    2020-12-31 18:05

    I don't think long polling is possible. The default request timeout for google appengine is 30 seconds. In long polling if the message takes more than 30 secs to generate, then it will fail. You are probably better off using short polling.

    Another approach is to "simulate" long polling withing the 30 sec limit. To do this if a message does not arrive within, say 20 sec, the server can send a "token" message instead of a normal message, requiring the client to consume it and connect again.

    There seems to be feature request (and its accepted) on google appengine for long polling

提交回复
热议问题