Long polling is a communication pattern used in web development to simulate server push. It is a technique used to keep a connection open between the client and the server for a long period of time, allowing the server to push data to the client whenever it is available.
This demo shows a simple example of long polling in action. By building a simple sensor monitoring system, we can see how long polling can be used to check for sensor updates and receive them in real-time.
To run the demo, follow these steps:
1. Clone the repository:
git clone <repo-url>
2. Navigate to the long-polling
folder:
cd communication-patterns/long-polling
3. Install the dependencies:
yarn install
4. Run the server:
yarn start
5. Follow postman collection to test the API:
Enjoy Demo!🎉