Skip to content

Conversation

wotermelon
Copy link
Contributor

Adjust the options that pass to the register, the driver option to support ioredis, and the redis option will be passed to the Redis client.

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

Great job!
I'd like to maintain this backwards compatible.
We should pass all the options in the same object, as well as driver.
Then internally we should do something like the following:

const Driver = opts.driver
delete opts.driver
client = Driver ? new Driver(opts) : redis.createClient(opts)

@wotermelon
Copy link
Contributor Author

Sorry, I'm new to this, now right?

README.md Outdated
Add it to you project with `register` and you are done!
You can access the *Redis* client via `fastify.redis`.

And you can custom your own redis client, use ``driver`` option, now support [ioredis](https://github.com/luin/ioredis) client, default is [redis](https://github.com/NodeRedis/node_redis).
Copy link
Member

Choose a reason for hiding this comment

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

If needed, you can pass a custom driver option, such as ioredis. By default the official redis client is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah.

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

LGTM
Thank you for contributing!

@delvedor delvedor merged commit 67a63d8 into fastify:master Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants