rewrite long polling