Simple way producer–consumer problem's implementation in NodeJs
Problem Name : Producer-Consumer Problem (Also Known as Bounded Buffer Problem ) Goal : It's explain you "multi-process resource synchronization problem". Problem Statement : there are many producers and many consumers, the work of producer is to generate/produce things/jobs/items any things and the work of consumer is to consume things/jobs/items/any things produced/generated by producer. What is the NodeJs ? Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Code : var express = require('express'); var app = express(); var queue = []; //Default Handler app.get('/',function(req,res){ res.send('Producer/Consumer Server'); }); //Producer Handler app