Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clustering support #20

Merged
merged 4 commits into from
Jan 20, 2019
Merged

Clustering support #20

merged 4 commits into from
Jan 20, 2019

Conversation

SGrondin
Copy link
Collaborator

@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))

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
lib/wrap-request.js Show resolved Hide resolved
@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
Collaborator

🎉 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.

3 participants