0.0.5 • Published 12 years ago

charlie v0.0.5

Weekly downloads
19
License
-
Repository
github
Last release
12 years ago

Charlie is a utility that implements the backoff algorithm described in Exponential Backoff in Distributed Systems.

Travis status

The usage is simple. Before making a request to an origin, let charlie know.

// arr is an array of strings used as a key
// timeout and maxDelay are in msec
var decision = charlie.ask(arr, timeout, maxDelay);
if(decision.state === 'go') {
    // make the request
}
else {
    // don't make the request
    console.log('Waiting until ' + decision.delay);
}

When the request succeeds, let Charlie know.

charlie.ok(arr);

When the request fails, let Charlie know.

charlie.notok(arr);
0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago