Sample implementation of non blocking long polling