Skip to content

Commit 8077bb7

Browse files
committed
update readme
1 parent 456eb0f commit 8077bb7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Elastic Loop
22
[![Build Status](https://travis-ci.org/grindcode/elastic-loop.svg?branch=master)](https://travis-ci.org/grindcode/elastic-loop) [![Dependency Status](https://david-dm.org/grindcode/elastic-loop.svg)](https://david-dm.org/grindcode/elastic-loop) [![devDependency Status](https://david-dm.org/grindcode/elastic-loop/dev-status.svg)](https://david-dm.org/grindcode/elastic-loop#info=devDependencies)
33

4-
Runs an interval with elastic timeout. Useful for loops supporting heavy load situations.
4+
Runs an interval with variable timeout. Useful for loops adapting to heavy load or other kind of situations.
55

66
## Get Started
77
```bash
@@ -21,22 +21,22 @@ Runs `function` in loop, mutating timeout depending on `stress`. Returns instanc
2121

2222
### Usage
2323
```javascript
24-
var loop = require('elastic-loop')
25-
var busy = require('node-busy')
24+
const loop = require('elastic-loop')
25+
const busy = require('node-busy')
2626

27-
monitor = busy()
27+
const monitor = busy()
2828

2929
// @cycle: current cycle fingerprint
30-
var run = function (cycle) {
30+
function run (cycle) {
3131
// → @cycle: { timeout: 1000, stress: 1 }
3232
}
3333

34-
var stress = function () {
34+
function stress () {
3535
// returns true if overloaded, false otherwise
3636
return monitor.blocked
3737
}
3838

39-
var cycle = loop(run, stress)
39+
const cycle = loop(run, stress)
4040

4141
// cycle.end()
4242

0 commit comments

Comments
 (0)