binary42-remix-stash 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +21 -9
- data/VERSION +1 -1
- data/benchmarks/payload.rb +3 -3
- data/lib/remix/stash.rb +20 -8
- data/remix-stash.gemspec +2 -2
- metadata +2 -2
data/README.markdown
CHANGED
@@ -1,20 +1,32 @@
|
|
1
|
-
|
1
|
+
Real docs coming soon! Check out the examples directory for more.
|
2
2
|
|
3
3
|
# Quick Specs
|
4
4
|
|
5
|
-
|
5
|
+
New API! I've rethought a lot of the API and this comes with a lot of new capabilities. More work is being done on making it as expressive as possible without terrible overhead. This includes vectorized keys which allow emulation of partial cache clearing as well as nice shortcuts like eval and gate for expressions. Options, clusters, and implicit scope are easy to manage on a stash-by-stash basis. Keys are also easy to pass in as it will create composite keys from whatever you pass in (as long as it has to_s) so no more ugly string interpolation all over the place.
|
6
|
+
|
7
|
+
It's fast (faster than memcache-client). It's simple (pure ruby and only a few hundred lines). It's tested (shoulda). Of course, because it's pure ruby it will run almost anywhere as well unlike many other clients.
|
6
8
|
|
7
9
|
It does require memcached 1.4+ but you should be running that anyway (if you aren't, upgrade already).
|
8
10
|
|
11
|
+
Take a look and let me know what you think!
|
12
|
+
|
9
13
|
# TODO
|
10
14
|
|
11
|
-
*
|
12
|
-
*
|
13
|
-
* optimize option merging with cache
|
14
|
-
* make clusters selectable per stash
|
15
|
-
* implement the rest of the memcached 1.4 binary API
|
15
|
+
* namespacing
|
16
|
+
* implement the rest of the memcached 1.4 binary API (replace, append, prepend)
|
16
17
|
* allow swappable cluster types for consistent hashing, ketama, etc...
|
17
18
|
* failsafe marshal load
|
18
19
|
* support non-marshal value dumps configured per stash
|
19
|
-
* support
|
20
|
-
*
|
20
|
+
* support multi vector sets
|
21
|
+
* thread safe cluster
|
22
|
+
* add block form
|
23
|
+
* quiet/multi command forms (will require a protocol refactoring most likely)
|
24
|
+
* server pings
|
25
|
+
* complete stats API
|
26
|
+
* incr/decr should take default value flags
|
27
|
+
* get/set add/replace read/write should allow a CAS flag to be passed
|
28
|
+
* accelerated binary API implementation with Ruby fallback
|
29
|
+
* redis support for vectors and/or value
|
30
|
+
* large key handling support
|
31
|
+
* UDP support (more experimentation on the tradeoffs)
|
32
|
+
* EventMachine integration (non-blocking?)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.6
|
data/benchmarks/payload.rb
CHANGED
@@ -56,7 +56,7 @@ Benchmark.bmbm do |b|
|
|
56
56
|
}
|
57
57
|
end
|
58
58
|
end
|
59
|
-
b.report('2k stash') do
|
59
|
+
b.report('2k remix-stash') do
|
60
60
|
LARGE_NUMBER.times {
|
61
61
|
stash.write(KEY, med_value)
|
62
62
|
stash.read(KEY)
|
@@ -78,7 +78,7 @@ Benchmark.bmbm do |b|
|
|
78
78
|
}
|
79
79
|
end
|
80
80
|
end
|
81
|
-
b.report('100b stash') do
|
81
|
+
b.report('100b remix-stash') do
|
82
82
|
LARGE_NUMBER.times {
|
83
83
|
stash.write(KEY, small_value)
|
84
84
|
stash.read(KEY)
|
@@ -100,7 +100,7 @@ Benchmark.bmbm do |b|
|
|
100
100
|
}
|
101
101
|
end
|
102
102
|
end
|
103
|
-
b.report('1b stash') do
|
103
|
+
b.report('1b remix-stash') do
|
104
104
|
LARGE_NUMBER.times {
|
105
105
|
stash.write(KEY, tiny_value)
|
106
106
|
stash.read(KEY)
|
data/lib/remix/stash.rb
CHANGED
@@ -32,7 +32,12 @@ class Remix::Stash
|
|
32
32
|
def initialize(name)
|
33
33
|
@name = name
|
34
34
|
@scope = nil
|
35
|
-
|
35
|
+
if name == :root
|
36
|
+
@local = @opts = {:coherency => :action, :ttl => 0, :cluster => :default}
|
37
|
+
else
|
38
|
+
@local = {}
|
39
|
+
@opts = stash.default.dup
|
40
|
+
end
|
36
41
|
end
|
37
42
|
|
38
43
|
def add(*keys)
|
@@ -81,18 +86,19 @@ class Remix::Stash
|
|
81
86
|
|
82
87
|
def default(opts = nil)
|
83
88
|
if opts
|
84
|
-
base = @opts.merge!(opts)
|
85
89
|
if opts.has_key? :coherency
|
86
90
|
[:dynamic, :action, :transaction].include?(opts[:coherency]) or raise ArgumentError,
|
87
91
|
"Invalid coherency setting used (#{opts[:coherency].inspect})"
|
88
92
|
end
|
89
|
-
|
90
|
-
|
93
|
+
@local.merge!(opts)
|
94
|
+
@opts.merge!(opts)
|
95
|
+
if @name == :root
|
96
|
+
@@instances.each do |name, stash|
|
97
|
+
stash.update_options unless name == :root
|
98
|
+
end
|
99
|
+
end
|
91
100
|
end
|
92
|
-
|
93
|
-
self == root ?
|
94
|
-
base :
|
95
|
-
root.default.merge(base)
|
101
|
+
@opts
|
96
102
|
end
|
97
103
|
|
98
104
|
def delete(*keys)
|
@@ -179,6 +185,12 @@ class Remix::Stash
|
|
179
185
|
cluster(opts).select(key) {|io| Protocol.set(io, key, value, opts[:ttl])}
|
180
186
|
end
|
181
187
|
|
188
|
+
protected
|
189
|
+
|
190
|
+
def update_options
|
191
|
+
@opts = stash.default.merge(@local)
|
192
|
+
end
|
193
|
+
|
182
194
|
private
|
183
195
|
|
184
196
|
KEY_SEPARATOR = '/'
|
data/remix-stash.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{remix-stash}
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian Mitchell"]
|
12
|
-
s.date = %q{2009-09-
|
12
|
+
s.date = %q{2009-09-22}
|
13
13
|
s.email = %q{binary42@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: binary42-remix-stash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Mitchell
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-22 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|