Pass backoff options from constructor

The Client constructor supports backoff configuration. This commit
exposes it to the end developer via the `peers` options object, in the
`backoff` property.
Example:

Gun({
  peers: {
    'url.com/gun': {
      backoff: { max: 1000, factor: 0.2 }
    }
  }
})
This commit is contained in:
Jesse Gibson 2016-12-12 16:24:51 -07:00
parent 30fe844cab
commit 304265e193

5
gun.js
View File

@ -2412,7 +2412,10 @@
return;
}
var client = Client.pool[url] = new Client(url);
var client = new Client(url, options.backoff);
// Add it to the pool.
Client.pool[url] = client;
// Listen to incoming messages.
client.on('message', function (msg) {