Giter Club home page Giter Club logo

catbox-memcached's People

Contributors

anthony-dibenedetto-olx avatar arb avatar chapel avatar cjihrig avatar danielb2 avatar devinivy avatar geek avatar hueniverse avatar iniva avatar jarrodyellets avatar lloydbenson avatar marsup avatar nargonath avatar njh avatar nvcexploder avatar vadzappa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

catbox-memcached's Issues

Hapi hangs if the memcached server is down

I'm trying to use catbox-memcached as caching provider in Hapi.
It works fine when the memcached server is running when I start the Hapi server, but when the memcached server is down on startup, the whole application freezes before starting the Hapi server.

Remove test connections

The memcached driver that this library requires uses consistent hashing to distribute the keys among the available servers. That means that if any server is down, all the keys that were stored in it are redistributed to the servers that are still up. The problem is that if this happens when an application is starting the adapter connection fails because it cannot connect to the server that is down (the adapter does a connection test before returning the control to the application).

The test connection should be removed (or rethinked) so applications can benefit from the error management the driver provides.

I will submit a PR for this soon. Meanwhile I will be using a fork in my project to test that it works OK.

Issues with the memcached driver

I have seen production issue with the memcached driver. The driver hangs if the memcached instance has a network partition. This is intermittent behavior. I was thinking of upgrading the underlying driver to this memjs, which redislabs has backed on their blog https://redislabs.com/node-js-memcached. Any thoughts on that kind of change?

Add domain support

memcached loose the current domain when doing requests to it. So we need to restore domains manually after each request to prevent strange errors from happening in hapi.

New maintainer

This module is not being maintainer to the hapi.js standards.

Stored and TTL Missing from Cached Item

Not sure if this is an implementation error, but after caching an item, neither the 'stored', or 'ttl' values are set - only the item.

https://github.com/hapijs/catbox

get(key, callback) - retrieve an item from the cache engine if found where:
key - a cache key object (see below).
callback - a function with the signature function(err, cached). If the item is not found, both err and cached are null. If found, the cached object contains the following:
item - the value stored in the cache using set().
stored - the timestamp when the item was stored in the cache (in milliseconds).
ttl - the remaining time-to-live (not the original value used when storing the object).

I've called set with...

cache.set(sid, {account: account}, 86400000, function (err) {...})

Retrieving the cached object with...

cache.get(sid, function (err, cached) {...}

Returns the cached object below, with 'account' set, but I don't see properties for 'ttl', and 'stored'?

{account: account}

Am I missing something?

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Getting a working proof of concept

I'm trying to get an example working. I've looked at the example provided, but it hasn't helped.

Here's my code:

var Hapi = require('hapi')
    , Catbox = require('catbox')
;

var options = {
    cors:true,  
    router:{
        isCaseSensitive:false,
    },
    cache: new Catbox.Client(require('catbox-memcached'),{
        location: "localhost:11211"
    })
};

var server = new Hapi.Server(8000, options);


server.start(function () {
    console.log('Server started at: ' + server.info.uri);
});

Here's the exception:

[1] cache must be a Function
[2] engine is required
[3] cache must be an array←[0m
    at Object.exports.assert (C:\Users\joshchan\github.com\CompassPHS\Survey-Site\node_modules\hapi\node_modules\hoek\lib\index.js:421:11)
    at Object.exports.assert (C:\Users\joshchan\github.com\CompassPHS\Survey-Site\node_modules\hapi\lib\schema.js:15:10)
    at new module.exports.internals.Server (C:\Users\joshchan\github.com\CompassPHS\Survey-Site\node_modules\hapi\lib\server.js:74:12)
    at Object.<anonymous> (C:\Users\joshchan\github.com\CompassPHS\Survey-Site\src\server\server.js:15:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain [as _onTimeout] (module.js:497:10)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

What am I missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.