example code for real-time polls