Long polling implementation.