stormpath / stormpath-sdk-node

Official Node.js SDK for the Stormpath User Management REST API
https://docs.stormpath.com/nodejs/jsdoc/
Apache License 2.0
92 stars 40 forks source link

Memcached Options #73

Open rdegges opened 10 years ago

rdegges commented 10 years ago

In the API docs for memcached -- it shows in the sample that the connection string is specified as 127.0.0.1:11211. When I tried this, it works.

In the docs, however, it says that the connection variable can be a string or an object. When I try the following, I get errors:

connection: {
  host: '127.0.0.1',
  port: 11211,
}

I believe what we should do is ensure that all backends support an object for the connection variable, and ensure they all support the standard host / port options -- this way it makes integration a lot simpler.

robertjd commented 10 years ago

We do pass along the options directly, see:

https://github.com/stormpath/stormpath-sdk-node/blob/master/lib/cache/MemcachedStore.js#L20

The way you're trying to pass the connection, as an object with named keys, is not supported by the node-memcached module. See the object documentation here

All that said, I did find two things that should be changed:

I'm removing the bug label

lhazlewood commented 10 years ago

@robertjd please create issues to fix the default port to 11211 so we don't lose this.

lhazlewood commented 10 years ago

Actually, nm, we can use this issue to reflect that work. Sorry for the noise!

robertjd commented 10 years ago

:) yep that was the idea

robertjd commented 9 years ago

In 0.6.0 the port documentation has been fixed and the connection value is now documented as "sever location"

Note: in code, the "sever location" value is still using a property called "connection"

I want to change that property to be called "severLocation", which will be a breaking change.

Adding 1.0 Label