Socket
Book a DemoInstallSign in
Socket

sync-memcached-store

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-memcached-store

A synchronous Fibers-powered memcached store for SyncCache module

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

sync-memcached-store

Synchronous Fibers-powered Memcached store for sync-cache. The store use syncho to retrieve data "synchronously" from memcached so the code needs to run in a Fiber.

Usage

npm install sync-memcached-store --save
var Sync = require('syncho')
    , SyncCache = require('sync-cache')
    , MC = require('sync-memcached-store')
    , mc = new MC({uri: 'localhost:11211', maxAge: 1000*60*60, ns: 'mynamespace'})
    , cache = new SyncCache({store: mc, load: mySyncFunction })
    ;

Sync(function () {
  console.log(cache.get('some-key'));
});

function mySyncFunction () {
  return 'some value';
}

Parameters

  • uri - memcached endpoint string, can be passed as a uri property of the options object instead
  • options - an options object

Options

  • uri - memcached endpoint
  • ns - optional namespace
  • maxAge - maximum number of milliseconds to keep items, defaults 60000
  • timeout - operation timeout, defaults 1000

Testing

Unit tests: npm test

Integration tests (require local memcached server running on default port): npm run integration

Keywords

sync

FAQs

Package last updated on 30 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts