Created
June 24, 2011 06:07
-
-
Save jasonsirota/1044307 to your computer and use it in GitHub Desktop.
DAL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#modeled on a kv store that can be swapped | |
#semantics are memcached protocol | |
require 'dalli' | |
class DB | |
def initialize(servers) | |
@dc = Dalli::Client.new(servers) | |
end | |
def self.get(key) | |
return @dc.get(key) | |
end | |
def self.set(key, value) | |
return @dc.set(key,value) | |
end | |
def self.delete(key) | |
return @dc.delete(key) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment