er_redis_data_server
v1.0.2
Published
A redis data store for event_request
Downloads
6
Maintainers
Readme
er_redis_data_server
Redis data server plugin for EventRequest
Plugin for event_request that implements a redis data server
Notes:
- Redis does not preserve value types ( numbers will not be numbers but stings after they are returned )
- Redis does not natively support objects. Any object you are trying to add will be JSON encoded and then JSON decoded when getting it
- The Redis Data Server has a MAX_TTL of 2147483647, that will be enforced if a bigger number is given
- There were issues with setting a ttl on locks, so currently the locks have no ttl set.
Use:
// Get the data server only
const RedisDataServer = require( 'er_redis_data_server' );
const DataServerPlugin = require( 'event_request/server/plugins/available_plugins/data_server_plugin' );
const app = require( 'event_request' )();
// Attach the cache server
app.apply( new DataServerPlugin( 'er_data_server', { dataServer: new RedisDataServer() } ) );