BackendStack21 / restana

Restana is a lightweight and fast Node.js framework for building RESTful APIs.
MIT License
467 stars 27 forks source link

Making requests processing prioritisation configurable #10

Closed jkyberneees closed 5 years ago

jkyberneees commented 5 years ago

restana prioritises HTTP requests processing by default using setImmediate, this default behavior allow us to reach bigger throughputs. However, under heavy load depending of how many other timers are used within your application workflows, using setImmediate might conflict with your requirements. From now on, this feature is configurable:

const service = require('restana')({
  prioRequestsProcessing: false
})

service.get('/hi', (req, res) => {
  res.send('Hello World!')
})
service.start()