spymemcached.jruby 1.0.9-java → 1.0.10-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8b5fb13cea1a40760e3c5238f88f4cf6dee3926
4
- data.tar.gz: 45cde2c049dad6c2a43b41de8995a97cf60e3706
3
+ metadata.gz: 8eb6188bd806396129dbd6186e427323e48454e2
4
+ data.tar.gz: f30b1e50f0d2630ef62eac42553f6f09d5e6a6be
5
5
  SHA512:
6
- metadata.gz: 2ff7964126978eee87bd847e1d7e7cfd60ba609f02728b5fbd28dc1c59bf874ac116a752ba9de4ffb072624b153ea058870f9a97ae0bec9111a8e4234c5a2225
7
- data.tar.gz: 4120645054ffc7d2d5615a4498321df32f5ce04d868d91569359f480bf809c52fc5b6cf72dffa59bfd4b1c5b04c17e616fe46f9eb76413d5a178f1b003b9064b
6
+ metadata.gz: 462954604f84eca014be63ab9048356d8571e26fca26feb204c984ae0dbc8ba8aec38d66fd5c44db8288cdaa8a466dff3640b6aa81b9c72f27f900e6764db111
7
+ data.tar.gz: eef22bc388f1ed4450b4b8928b554c7efeb4bd41aa597e2180d2145d0665314692ce02b7f73ebb31fb7f1fef85ea64ed43b2bd73d1b57386da6eb97d850c20cf
data/README.md CHANGED
@@ -1,11 +1,9 @@
1
- Spymemcached.jruby
2
- ================
1
+ # Spymemcached.jruby
3
2
 
4
3
  A JRuby extension wraps the latest spymemcached client.
4
+ Fastest jruby memcached client, threadsafe.
5
5
 
6
- Usage
7
- ----------------
8
-
6
+ ## Usage
9
7
 
10
8
  Start a local networked memcached server:
11
9
 
@@ -28,16 +26,48 @@ Valid +options+ are:
28
26
  [:timeout] Time to use as the socket read timeout, seconds. Defaults to 0.5 sec.
29
27
  [:binary] Talks binary protocol with Memcached server. Default to true.
30
28
 
31
- Rails 3 & 4
29
+ ### Rails 4
30
+
31
+ Use [spymemcached_store](https://github.com/ThoughtWorksStudios/spymemcached_store) gem to integrate ActiveSupport cache store and spymemcached.jruby gem.
32
+
33
+ ### Rails 3
34
+
35
+ require 'spymemcached'
36
+ config.cache_store = :mem_cache_store, Spymemcached.new(servers, options).rails23
37
+
38
+ ### Rails 2.x
39
+
40
+ require 'spymemcached'
41
+ ActionController::Base.cache_store = :mem_cache_store, Spymemcached.new(servers, options).rails23
42
+
43
+ ## Compatibility
44
+
45
+ The most important different between spymemcached.jruby and other non spymemcached backended memcache client is the support of option :raw.
46
+
47
+ As Spymemcached provides mechanism to encode and decode cache data, spymemcached.jruby does marshal dump & load for Ruby object in Java except Ruby string and integer.
48
+
49
+ Any Ruby String or Integer type cache data will be directly converted to Java String or Integer.
32
50
 
33
- TODO
51
+ Hence we don't consider :raw option in spymemcached.jruby.
34
52
 
35
- Rails 2.3
53
+ However, Rails cache store supports :raw option too when doing read and write on local cache.
54
+ This behaviour is kept as I'm not sure what to do with it. I'm happy to fix it if you found anything wrong with it.
36
55
 
37
- ActionController::Base.cache_store = :mem_cache_store, Spymemcached.new(servers).rails23
56
+ ## Default behaviors
38
57
 
58
+ Spymemcached.jruby applies:
39
59
 
40
- Performance
41
- ---------------
60
+ * Ketama key hash algorithm (see Spymemcached document or [RJ's blog post](http://www.last.fm/user/RJ/journal/2007/04/10/392555/) for details)
61
+ * Gzip compressed when the cache data size is larger than 16kb.
62
+ * Binary protocol
63
+
64
+ Other default settings see Spymemcached DefaultConnectionFactory for details.
65
+
66
+ ## Performance
42
67
 
43
68
  [Benchmark result](https://github.com/ThoughtWorksStudios/memcached-client-benchmark) compared with gem dalli and jruby-memcached
69
+
70
+ ## Further resources
71
+
72
+ * [Spymemcached](https://code.google.com/p/spymemcached/)
73
+ * [Spymemcached Optimizations](https://code.google.com/p/spymemcached/wiki/Optimizations)
@@ -15,6 +15,9 @@ class Spymemcached
15
15
  end
16
16
 
17
17
  def get_multi(*args)
18
+ if [Hash, TrueClass, FalseClass].include?(args.last)
19
+ args.pop
20
+ end
18
21
  op(:get_multi, *args)
19
22
  end
20
23
 
@@ -24,6 +24,12 @@ class SpymemcachedRails23Test < Test::Unit::TestCase
24
24
  assert @client.stats.values.first
25
25
  end
26
26
 
27
+ def test_rails3_api_compatible
28
+ @client.set("key1", '0')
29
+ @client.set("key2", '1')
30
+ assert_equal({"key1" => '0', 'key2' => '1'}, @client.get_multi(['key1', 'key2'], :raw => true))
31
+ end
32
+
27
33
  def response
28
34
  Spymemcached::Rails23::Response
29
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spymemcached.jruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: java
6
6
  authors:
7
7
  - Xiao Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-31 00:00:00.000000000 Z
11
+ date: 2014-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake