This demo demonstrates how the Flipper poller dynamically adjusts its polling frequency using the poll-interval header and how it responds to the poll-shutdown header. To run the demo, you need a server to provide headers and a client to poll that server.
Prerequisites
Ensure you have bundle installed and the environment is set up for Ruby.
Execution Steps
- Start the Server: Open a terminal and run the server script. The server listens on
http://localhost:3000 and provides an interactive prompt to control headers. - Start the Client: Open a second terminal and run the client script. The client starts with a default minimum interval of 10 seconds.
# Terminal 1: Start the Server
bundle exec ruby examples/cloud/poll_interval/server.rb
# Terminal 2: Start the Client
bundle exec ruby examples/cloud/poll_interval/client.rb