Uses stack and Async/Await approach
Use this for your express routes if you need those concurrent requests to behave in sequence. If you don't need every request to be queued, set a config and specify your unique identifier to group the queues.
> npm install express-request-queue --saveimportRequestQfrom'express-request-queue';constq=RequestQ();route.post('/book',q.run(async(req,res,next){awaitlongRunningTask();res.json({});}));Grouping queues base on your request payload:
constconfig={unique: true,// by setting this to true, queues are grouped by thier identifiersfrom: 'body',// what type of req payload the identifier is located fromname: 'id'// name of the field to reference from}constq=RequestQ(config);MIT