https://github.com/killme2008/ring-session-memcached
Ring sessions stored in memcached
https://github.com/killme2008/ring-session-memcached
Last synced: over 1 year ago
JSON representation
Ring sessions stored in memcached
- Host: GitHub
- URL: https://github.com/killme2008/ring-session-memcached
- Owner: killme2008
- Created: 2012-01-16T09:38:56.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-01-16T12:43:18.000Z (over 14 years ago)
- Last Synced: 2025-03-23T20:43:46.083Z (over 1 year ago)
- Language: Clojure
- Homepage:
- Size: 93.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ring-session-memcached
This permits you to store your ring session in memcached.
## Usage
In your project.clj:
[ring-session-memcached "0.0.1"]
Wrap your routes:
(use 'ring.middleware.session.memcached)
(-> routes
(wrap-session {:store (mem-store "host1:11211 host2:11211")}))
The mem-store fn provides a few options to give it:
:name Memcached client's name
:protocol Protocol to talk with memcached,a string value in text,binary or kestrel,default is text protocol.
:hash Hash algorithm,a string value in consistent or standard,default is standard hash.
:timeout Operation timeout in milliseconds,default is five seconds.
:pool Connection pool size,default is one,and it is suitable for most applications.
For example:
(mem-store "localhost:11211" :timeout 3000 :hash "consistent")
## License
Copyright (C) 2012 Dennis Zhuang
Distributed under the Eclipse Public License, the same as Clojure.