Skip to content

Conversation

@SGrondin
Copy link
Contributor

@SGrondin SGrondin commented Jan 20, 2019

I tested it manually because adding an automated test for it means adding a dev dependency on either redis or ioredis.

Usage

const Bottleneck = require('bottleneck')
const Redis = require('redis')

const client = Redis.createClient({ /* options */ })
const connection = new Bottleneck.RedisConnection({ client })
connection.on('error', err => console.error(err))

const octokit = new Octokit({
  throttle: {
    onAbuseLimit: (...args) => console.log(...args),
    onRateLimit: (...args) => console.log(...args),
    Bottleneck, // full, not the light bundle
    connection
  }
})

await connection.disconnect()

It also supports the ioredis library:

const Redis = require('ioredis')
const client = new Redis({ /* options */ })
const connection = new Bottleneck.IORedisConnection({ client })
connection.on('error', err => console.error(err))

@SGrondin SGrondin changed the title [WIP] Clustering proof of concept Clustering proof of concept Jan 20, 2019
@SGrondin SGrondin changed the title Clustering proof of concept Clustering support Jan 20, 2019
@SGrondin SGrondin added the Type: Feature New feature or request label Jan 20, 2019
Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@gr2m gr2m merged commit e745138 into master Jan 20, 2019
@octokitbot
Copy link
Contributor

🎉 This PR is included in version 2.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@SGrondin SGrondin deleted the clustering branch May 9, 2019 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants