{"action":"published","release":{"url":"https://api.github.com/repos/mwpastore/dalli-rate_limiter/releases/2575904","assets_url":"https://api.github.com/repos/mwpastore/dalli-rate_limiter/releases/2575904/assets","upload_url":"https://uploads.github.com/repos/mwpastore/dalli-rate_limiter/releases/2575904/assets{?name,label}","html_url":"https://github.com/mwpastore/dalli-rate_limiter/releases/tag/v0.2.0","id":2575904,"tag_name":"v0.2.0","target_commitish":"master","name":"","draft":false,"author":{"login":"mwpastore","id":8540936,"avatar_url":"https://avatars.githubusercontent.com/u/8540936?v=3","gravatar_id":"","url":"https://api.github.com/users/mwpastore","html_url":"https://github.com/mwpastore","followers_url":"https://api.github.com/users/mwpastore/followers","following_url":"https://api.github.com/users/mwpastore/following{/other_user}","gists_url":"https://api.github.com/users/mwpastore/gists{/gist_id}","starred_url":"https://api.github.com/users/mwpastore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwpastore/subscriptions","organizations_url":"https://api.github.com/users/mwpastore/orgs","repos_url":"https://api.github.com/users/mwpastore/repos","events_url":"https://api.github.com/users/mwpastore/events{/privacy}","received_events_url":"https://api.github.com/users/mwpastore/received_events","type":"User","site_admin":false},"prerelease":false,"created_at":"2016-02-08T22:56:11Z","published_at":"2016-02-08T23:23:30Z","assets":[],"tarball_url":"https://api.github.com/repos/mwpastore/dalli-rate_limiter/tarball/v0.2.0","zipball_url":"https://api.github.com/repos/mwpastore/dalli-rate_limiter/zipball/v0.2.0","body":"I'm very excited to announce a new release of Dalli::RateLimiter! This release addresses several shortcomings of the original version. The locking scheme has been greatly improved, leading to much better performance and much fewer lock timeouts. The average number of round-trips to Memcached has been greatly reduced, from seven plus one per lock attempt to two per lock attempt, leading to much less wall-clock time and load on the network and the backing store. Additionally, Dalli::RateLimiter will no longer hold a connection while waiting for a lock, so the ConnectionPool should perform more optimally.\r\n\r\nTo give you an idea of the improvements from 0.1.x to 0.2.0, my benchmarking shows that the new version can process 100,000 requests under heavy concurrency (100 threads) in about one tenth of the time as the old version; about 4,000 iterations per second (cf. 400). Moreover, the new version completes the benchmark with zero lock timeouts (cf. over 3,000). The numbers are even more favorable when the kgio gem is loaded. Information about these simplistic benchmarks can be found in the README.\r\n\r\nIn addition to these improvements, I've added a new block form that will perform a sleep-while loop on your behalf, and yield to the block when it can. This extremely convenient method should help adoption of this library and improve compatibility with other, similar libraries (like Sidekiq::Limiter). This method accepts an optional wait timeout and an error is raised when the timeout is reached. An example of this new syntax can be found in the README.\r\n\r\nThe biggest breaking change is that locking can no longer be disabled. Instead of its own mutex, Dalli::RateLimiter now relies on Memcached's built-in opportunistic locking scheme. This means that the rate limiting is now more \"correct\" and reliable, but at the cost of some flexibility. The lock timeout can be adjusted and a custom error is raised when the lock timeout is reached. Please see the README for more information.\r\n\r\nAdditionally, instead of raising DalliError, Dalli::RateLimiter now raises its own LockError and LimitError when a lock cannot be obtained or a wait timeout is reached. Please see the README for examples."}}