Redis adapter for Integreat
Adapter that lets Integreat access content in a Redis database.
Getting started
Prerequisits
Requires node v14 and Integreat v0.8.
Installing and using
Install from npm:
npm install integreat-adapter-redis
Example of use:
import integreat from 'integreat'
import redisAdapter from 'integreat-adapter-redis'
import defs from './config'
const resources = integreat.resources({ transporters: { redis: redisAdapter } })
const great = Integreat.create(defs, resources)
// ... and then dispatch actions as usual
Example source configuration:
{
id: 'store',
adapter: 'redis',
endpoints: [{
options: {
prefix: 'store',
redis: { host: 'localhost', port: 6789 },
concurrency: 5
useTypeAsPrefix: true // Default is `true`
}
}]
}
The redis
endpoint options are sent as-is to redis.createClient()
.
See node_redis documentation for options.
Running the tests
The tests can be run with npm test
.
Contributing
Please read CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests.
License
This project is licensed under the ISC License - see the LICENSE file for details.