У меня есть клиенты, отправляющие задачи, которые должен выполнять сервер, но эти запросы должны обрабатываться в очереди как мода. Любая идея, как я могу это сделать? Благодарю.Бэкэнд ExpressJS отправляет запросы в очередь
express.Router().post('/tasks', function(req, res){
//This is the task to perform. While being performed, another user
//might send a request AND should only be processed when this is done.
//This should also flag the pending task if it is completed.
Promise.resolve(req.body)
.then(function() {
//..
})
.catch(function(error) {
//....
})
})
посмотреть [здесь] (https://www.npmjs.com/p ackage/Bluebird-очереди) – Satyajeet