neat-rr

0.0.1 • Public • Published

ad-rr

Get upstream HTTP server host addresses, which are passed in a round-robin manner.

Install

npm install neat-rr

Hello RR

const rr = require('./index.js')
 
const arr = [1, 2, 3, 4, 5]
const getRR = rr(arr);
 
let n = 0;
while (< 10) {
  console.log(`Get ${getRR()} in ${n} times.`)
  n++
}
// Get 1 in 0 times.
// Get 2 in 1 times.
// Get 3 in 2 times.
// Get 4 in 3 times.
// Get 5 in 4 times.
// Get 1 in 5 times.
// Get 2 in 6 times.
// Get 3 in 7 times.
// Get 4 in 8 times.
// Get 5 in 9 times.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i neat-rr

      Weekly Downloads

      1

      Version

      0.0.1

      License

      MIT

      Last publish

      Collaborators

      • zhuqiuyang