Poseidon Memcached
Poseidon Memcached provides a promise layer around the node memcached
module
with the help of the Poseidon library.
Install
To get started simply run
npm install poseidon-memcached
Introduction
A basic example of performing serveral operations on a cache which would normally result in callback hell is shown below.
require '../index' Driverconfigure'default' servers: 'localhost:11212' cache = 'default' cacheadd'test' foo: 'bar' 0then -> consolelog 'object added' cacheget'test'then consolelog 'object retrieved'obj cachedel'test'then -> consolelog 'object deleted' cacheadd'test'foo: 'bar returns' 0then -> cacheadd'test2'bar: 'foo'0then -> consolelog 'new objects added' cacheget'test''test2'then consolelog 'objects retrieved'objsfail consoleerror errfinally -> consolelog 'connection closed' cacheenddone
API
All functions of the original module are available
get
gets
getMulti
add
set
del
cas
flush
License
Copyright(c) 2013-2014, Playlyfe Technologies, developers@playlyfe.com, http://dev.playlyfe.com/