Class: Client

Client

new Client(client, configopt)

Construct new instance of the client interface.
Parameters:
Name Type Attributes Description
client RedisClient
config Object <optional>
configuration values. See Client#_configure
Source:

Methods

(private) _configure(configopt)

Configure the redis client. This supports multiple invocations, allowing changing existing configuration. Most configuration values are optional, defaulting to the existing value or the built-in default values.
Parameters:
Name Type Attributes Description
config Object <optional>
configuration values
Properties
Name Type Attributes Description
key String <optional>
key to use in Redis
batch_size Number <optional>
size of a single batch
Source:

(private) _getLatest(optionsopt, callback)

Get the latest added items. This retrieves an array of ordered, most-recently-added items, of size .
Parameters:
Name Type Attributes Description
options Object <optional>
options for retrieving items
Properties
Name Type Attributes Description
key String <optional>
key to use; overriding the cache's key
callback function callback(err, items)
Source:
To Do:
  • allow overriding the batch size used

get(optionsopt, callback)

Retrieve items from cache. Using a single item index, we can look forward (towards the newest items) or behind (towards the oldest items). By default, all the newer items are returned, even if the result array size is larger than . Looking behind is limited to return an array of maxium size of .
Parameters:
Name Type Attributes Description
options Object <optional>
options for fetching
Properties
Name Type Attributes Default Description
id Number | null <optional>
id of item
key String <optional>
key to use; overriding the cache's key
newer Boolean <optional>
true whether to return newer or older items
callback function callback(err, items)
Source:
To Do:
  • allow overriding the batch size