dalli 3.0.2 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of dalli might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fadd6651330b2d8455d781253451bd4e47d6caaaad9c12002284c6541727adb
4
- data.tar.gz: ea65f2d7199c5dea247c2909ac90775240bd3da1ccfaebcebc916788a8b0ebf2
3
+ metadata.gz: adcf2507fd177cbc44167154462aae102a6f34f9cd6a85ba29ea9a26e87efce6
4
+ data.tar.gz: 57bd7da6c8c90fbcd99c4738bdb061df3630df0ff17ead1cc510d5d58f8677e2
5
5
  SHA512:
6
- metadata.gz: 368db20ef7ceb7a8301e8e027107ce90b238295f59aa8e1412f1e34a30a0e903ae56b6a07b2963eee0bc1a540fded0cacd3092a02f25ad1c17a21a05320baaf3
7
- data.tar.gz: 32cc139bc122233910dddb62e1e3a6e1efec95e19d181dab04c8ced725806e238e1e6a62797cbbd8336e6e16b4a4a394c2f937bcaf8fffa63f66149d9f598e8c
6
+ metadata.gz: cec1cceffc54713b77746ec455ddd3817b0dad37ceacb33d20f5f82a51015c7d82788ad78d043f4859d26a6c236bb57d8aac053770ea464827c5c22f07057d98
7
+ data.tar.gz: 70e93ae5cca84bc211315359391bad55b2f31908604ee195f42e701b472ab469074f3ee9350618491cfbf9d34b53f4e41950998e8e34cd446d8c4aca63d4b0d4
data/Gemfile CHANGED
@@ -1,10 +1,16 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
5
7
  group :test do
6
- gem "minitest"
7
- gem "rake"
8
- gem "simplecov"
9
- gem "ruby-prof", platform: :mri
8
+ gem 'minitest'
9
+ gem 'rake'
10
+ gem 'rubocop'
11
+ gem 'rubocop-minitest'
12
+ gem 'rubocop-performance'
13
+ gem 'rubocop-rake'
14
+ gem 'ruby-prof', platform: :mri
15
+ gem 'simplecov'
10
16
  end
data/History.md CHANGED
@@ -1,6 +1,34 @@
1
1
  Dalli Changelog
2
2
  =====================
3
3
 
4
+ 3.0.6
5
+ ==========
6
+
7
+ - Fix regression in SASL authentication response parsing (petergoldstein)
8
+
9
+ 3.0.5
10
+ ==========
11
+
12
+ - Add Rubocop and fix most outstanding issues (petergoldstein)
13
+ - Extract a number of classes, to simplify the largest classes (petergoldstein)
14
+ - Ensure against socket corruption if an error occurs in a multi block (petergoldstein)
15
+
16
+ 3.0.4
17
+ ==========
18
+
19
+ - Clean connections and retry after NetworkError in get_multi (andrejbl)
20
+ - Internal refactoring and cleanup (petergoldstein)
21
+
22
+ 3.0.3
23
+ ==========
24
+
25
+ - Restore ability for `compress` to be disabled on a per request basis (petergoldstein)
26
+ - Fix broken image in README (deining)
27
+ - Use bundler-cache in CI (olleolleolle)
28
+ - Remove the OpenSSL extensions dependency (petergoldstein)
29
+ - Add Memcached 1.5.x to the CI matrix
30
+ - Updated compression documentation (petergoldstein)
31
+
4
32
  3.0.2
5
33
  ==========
6
34
 
data/README.md CHANGED
@@ -1,161 +1,50 @@
1
1
  Dalli [![Tests](https://github.com/petergoldstein/dalli/actions/workflows/tests.yml/badge.svg)](https://github.com/petergoldstein/dalli/actions/workflows/tests.yml)
2
2
  =====
3
3
 
4
- Dalli is a high performance pure Ruby client for accessing memcached servers. It works with memcached 1.4+ only as it uses the newer binary protocol. It should be considered a replacement for the memcache-client gem.
4
+ Dalli is a high performance pure Ruby client for accessing memcached servers.
5
5
 
6
- The name is a variant of Salvador Dali for his famous painting [The Persistence of Memory](http://en.wikipedia.org/wiki/The_Persistence_of_Memory).
7
-
8
- ![Persistence of Memory](http://www.virtualdali.com/assets/paintings/31PersistenceOfMemory.jpg)
9
-
10
- Dalli's initial development was sponsored by [CouchBase](http://www.couchbase.com/). Many thanks to them!
11
-
12
- Supported Ruby versions and implementations
13
- ------------------------------------------------
14
-
15
- As of Dalli version 3.0 the following Ruby versions are supported:
16
-
17
- * Ruby 2.5.x, 2.6.x, 2.7.x, 3.0.x
18
- * JRuby 9.2.x, 9.3.x
19
-
20
- If you have problems, please enter an issue.
21
-
22
-
23
- Installation and Usage
24
- ------------------------
25
-
26
- Remember, Dalli **requires** memcached 1.4+. You can check the version with `memcached -h`. Please note that the memcached version that *Mac OS X Snow Leopard* ships with is 1.2.8 and it won't work. Install the most recent version of memcached using Homebrew with
27
-
28
- brew install memcached
29
-
30
- On Ubuntu you can install it by running:
31
-
32
- apt-get install memcached
33
-
34
- You can verify your installation using this piece of code:
35
-
36
- ```bash
37
- gem install dalli
38
- ```
39
-
40
- ```ruby
41
- require 'dalli'
42
- options = { namespace: "app_v1", compress: true }
43
- dc = Dalli::Client.new('localhost:11211', options)
44
- dc.set('abc', 123)
45
- value = dc.get('abc')
46
- ```
47
-
48
- With SSL enabled:
49
- ```ruby
50
- require 'dalli'
51
- ssl_context = OpenSSL::SSL::SSLContext.new
52
- ssl_context.ca_file = "./myCA.pem"
53
- ssl_context.ssl_version = :SSLv23
54
- ssl_context.verify_hostname = true if ssl_context.respond_to?(:verify_hostname=)
55
- ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
56
-
57
- dc = Dalli::Client.new("memcached:11212", ssl_context: ssl_context)
58
- dc.set("abc", 123)
59
- value = dc.get("abc")
60
- ```
61
-
62
- The test suite requires memcached 1.4.3+ with SASL enabled (`brew install memcached --enable-sasl ; mv /usr/bin/memcached /usr/bin/memcached.old`). Currently only supports the PLAIN mechanism.
63
-
64
- Dalli has no runtime dependencies.
65
-
66
- Configuration
67
- ------------------------
68
-
69
- **servers**: An Array of "host:port:weight" where weight allows you to distribute cache unevenly.
70
-
71
- Dalli::Client accepts the following options. All times are in seconds.
72
-
73
- **expires_in**: Global default for key TTL. Default is 0, which means no expiry.
6
+ Dalli supports:
74
7
 
75
- **namespace**: If specified, prepends each key with this value to provide simple namespacing. Default is nil.
8
+ * Simple and complex memcached configurations
9
+ * Failover between memcached instances
10
+ * Fine-grained control of data serialization and compression
11
+ * Thread-safe operation (either through use of a connection pool, or by using the Dalli client in threadsafe mode)
12
+ * SSL/TLS connections to memcached
13
+ * SASL authentication
76
14
 
77
- **failover**: Boolean, if true Dalli will failover to another server if the main server for a key is down. Default is true.
78
-
79
- **threadsafe**: Boolean. If true Dalli ensures that only one thread is using a socket at a given time. Default is true. You can set to false if you are using the Client within a thread-safe connection pool.
80
-
81
- **serializer**: The serializer to use for objects being stored (ex. JSON).
82
- Default is Marshal.
83
-
84
- **compress**: Boolean, if true Dalli will gzip-compress values larger than compression_min_size. Default is true.
85
-
86
- **compression_min_size**: Minimum value byte size for which to attempt compression. Default is 1K.
87
-
88
- **compressor**: The compressor to use for objects being stored.
89
- Default is zlib, implemented under `Dalli::Compressor`.
90
- If serving compressed data using nginx's HttpMemcachedModule, set `memcached_gzip_flag 2` and use `Dalli::GzipCompressor`
91
-
92
- **keepalive**: Boolean. If true, Dalli will enable keep-alive for socket connections. Default is true.
93
-
94
- **socket_timeout**: Timeout for all socket operations (connect, read, write). Default is 1.
95
-
96
- **socket_max_failures**: When a socket operation fails after socket_timeout, the same operation is retried. This is to not immediately mark a server down when there's a very slight network problem. Default is 2.
97
-
98
- **socket_failure_delay**: Before retrying a socket operation, the process sleeps for this amount of time. Default is 0.1. Set to nil for no delay.
99
-
100
- **down_retry_delay**: When a server has been marked down due to many failures, the server will be checked again for being alive only after this amount of time. Don't set this value too low, otherwise each request which tries the failed server might hang for the maximum **socket_timeout**. Default is 30 seconds.
101
-
102
- **value_max_bytes**: The maximum size of a value in memcached. Defaults to 1MB, this can be increased with memcached's -I parameter. You must also configure Dalli to allow the larger size here.
103
-
104
- **error_when_over_max_size**: Boolean. If true, Dalli will throw a Dalli::ValueOverMaxSize exception when trying to store data larger than **value_max_bytes**. Defaults to false, meaning only a warning is logged.
105
-
106
- **username**: The username to use for authenticating this client instance against a SASL-enabled memcached server. Heroku users should not need to use this normally.
107
-
108
- **password**: The password to use for authenticating this client instance against a SASL-enabled memcached server. Heroku users should not need to use this normally.
109
-
110
- **sndbuf**: In bytes, set the socket SO_SNDBUF. Defaults to operating system default.
111
-
112
- **rcvbuf**: In bytes, set the socket SO_RCVBUF. Defaults to operating system default.
113
-
114
- **cache_nils**: Boolean. If true Dalli will not treat cached `nil` values as 'not found' for `#fetch` operations. Default is false.
115
-
116
- **raise_errors**: Boolean. When true DalliStore will reraise Dalli:DalliError instead swallowing the error. Default is false.
117
-
118
- **instrument_errors**: Boolean. When true DalliStore will send notification of Dalli::DalliError via a 'cache_error.active_support' event. Default is false.
119
-
120
- Features and Changes
121
- ------------------------
15
+ The name is a variant of Salvador Dali for his famous painting [The Persistence of Memory](http://en.wikipedia.org/wiki/The_Persistence_of_Memory).
122
16
 
123
- By default, Dalli is thread-safe. Disable thread-safety at your own peril.
17
+ ![Persistence of Memory](https://upload.wikimedia.org/wikipedia/en/d/dd/The_Persistence_of_Memory.jpg)
124
18
 
125
- Dalli does not need anything special in Unicorn/Passenger since 2.0.4.
126
- It will detect sockets shared with child processes and gracefully reopen the
127
- socket.
128
19
 
129
- Note that Dalli does not require ActiveSupport or Rails. You can safely use it in your own Ruby projects.
20
+ ## Documentation and Information
130
21
 
131
- [View the Client API](http://www.rubydoc.info/github/mperham/dalli/Dalli/Client)
22
+ * [User Documentation](https://github.com/petergoldstein/dalli/wiki) - The documentation is maintained in the repository's wiki.
23
+ * [Announcements](https://github.com/petergoldstein/dalli/discussions/categories/announcements) - Announcements of interest to the Dalli community will be posted here.
24
+ * [Bug Reports](https://github.com/petergoldstein/dalli/issues) - If you discover a problem with Dalli, please submit a bug report in the tracker.
25
+ * [Forum](https://github.com/petergoldstein/dalli/discussions/categories/q-a) - If you have questions about Dalli, please post them here.
26
+ * [Client API](https://www.rubydoc.info/github/petergoldstein/dalli/master/Dalli/Client) - Ruby documentation for the `Dalli::Client` API
132
27
 
133
- Helping Out
134
- -------------
28
+ ## Contributing
135
29
 
136
30
  If you have a fix you wish to provide, please fork the code, fix in your local project and then send a pull request on github. Please ensure that you include a test which verifies your fix and update `History.md` with a one sentence description of your fix so you get credit as a contributor.
137
31
 
138
- We're not accepting new compressors. They are trivial to add in an initializer. See #385 (LZ4), #406 (Snappy)
139
-
140
- Thanks
141
- ------------
142
-
143
- Mike Perham - for originally authoring the Dalli project and serving as maintainer and primary contributor
32
+ ## Appreciation
144
33
 
145
- Eric Wong - for help using his [kgio](http://bogomips.org/kgio/) library.
34
+ Dalli would not exist in its current form without the contributions of many people. But special thanks go to several individuals and organizations:
146
35
 
147
- Brian Mitchell - for his remix-stash project which was helpful when implementing and testing the binary protocol support.
36
+ * Mike Perham - for originally authoring the Dalli project and serving as maintainer and primary contributor for many years
37
+ * Eric Wong - for help using his [kgio](http://bogomips.org/kgio/) library.
38
+ * Brian Mitchell - for his remix-stash project which was helpful when implementing and testing the binary protocol support.
39
+ * [CouchBase](http://couchbase.com) - for their sponsorship of the original development
148
40
 
149
- [CouchBase](http://couchbase.com) - for their project sponsorship
150
41
 
151
- Authors
152
- ----------
42
+ ## Authors
153
43
 
154
44
  * [Peter M. Goldstein](https://github.com/petergoldstein) - current maintainer
155
45
  * [Mike Perham](https://github.com/mperham) and contributors
156
46
 
157
47
 
158
- Copyright
159
- -----------
48
+ ## Copyright
160
49
 
161
50
  Copyright (c) Mike Perham, Peter M. Goldstein. See LICENSE for details.
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  puts "You can remove `require 'dalli/cas/client'` as this code has been rolled into the standard 'dalli/client'."