integrate long polling js client