All Projects → yegor256 → Zache

yegor256 / Zache

Licence: mit
Zero-footprint Ruby In-Memory Thread-Safe Cache

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Zache

tacky
Primitive Object Memoization for Ruby
Stars: ✭ 14 (-53.33%)
Mutual labels:  ruby-gem, cache
Python Common Cache
This project is a cache component based on the memory and it is lightweight, simple and customizable. 🐍 😃
Stars: ✭ 21 (-30%)
Mutual labels:  cache
Key Cache
Storing data in the form of key into the file
Stars: ✭ 8 (-73.33%)
Mutual labels:  cache
Tty Which
Cross-platform implementation of Unix `which` command
Stars: ✭ 11 (-63.33%)
Mutual labels:  ruby-gem
Weixinmpsdk
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
Stars: ✭ 7,098 (+23560%)
Mutual labels:  cache
Backtrace
Ruby gem to print exception backtrace nicely
Stars: ✭ 14 (-53.33%)
Mutual labels:  ruby-gem
Gitlab
Ruby wrapper and CLI for the GitLab REST API
Stars: ✭ 939 (+3030%)
Mutual labels:  ruby-gem
Egjs Persist
Provide cache interface to handle persisted data among history navigation.
Stars: ✭ 27 (-10%)
Mutual labels:  cache
Node Github Cache
Provides transparent caching for node-github api calls
Stars: ✭ 15 (-50%)
Mutual labels:  cache
Data mining
The Ruby DataMining Gem, is a little collection of several Data-Mining-Algorithms
Stars: ✭ 10 (-66.67%)
Mutual labels:  ruby-gem
Rw File Cache
🗄️ PHP File-based Caching Library
Stars: ✭ 10 (-66.67%)
Mutual labels:  cache
Mlcache
A library make cache easily
Stars: ✭ 9 (-70%)
Mutual labels:  cache
Devise Jwt
JWT token authentication with devise and rails
Stars: ✭ 881 (+2836.67%)
Mutual labels:  ruby-gem
Gparticlesio
Simple IO transfer particles cache in DCC application
Stars: ✭ 8 (-73.33%)
Mutual labels:  cache
Next Pwa
Zero config PWA plugin for Next.js, with workbox 🧰
Stars: ✭ 909 (+2930%)
Mutual labels:  cache
Wordpress Rest Cache
WordPress Plugin to lazy cache HTTP requests in database and update via cron.
Stars: ✭ 8 (-73.33%)
Mutual labels:  cache
Cachep2p
"More users = More capacity"
Stars: ✭ 855 (+2750%)
Mutual labels:  cache
Easy Cache
a cache trait for Laravel to do cache eaily
Stars: ✭ 12 (-60%)
Mutual labels:  cache
Ecache
👏👏 Integrate cache(redis) [flask etc.] with SQLAlchemy.
Stars: ✭ 28 (-6.67%)
Mutual labels:  cache
Androidutilcode
AndroidUtilCode 🔥 is a powerful & easy to use library for Android. This library encapsulates the functions that commonly used in Android development which have complete demo and unit test. By using it's encapsulated APIs, you can greatly improve the development efficiency. The program mainly consists of two modules which is utilcode, which is commonly used in development, and subutil which is rarely used in development, but the utils can be beneficial to simplify the main module. 🔥
Stars: ✭ 30,239 (+100696.67%)
Mutual labels:  cache

EO principles respected here DevOps By Rultor.com We recommend RubyMine

Build Status Build status Gem Version Maintainability Yard Docs

License Test Coverage Hits-of-Code

It's a simple Ruby gem for in-memory cache. Read this blog post to understand what Zache is for.

First, install it:

$ gem install zache

Then, use it like this

require 'zache'
zache = Zache.new
# Expires in 5 minutes
v = zache.get(:count, lifetime: 5 * 60) { expensive() }

By default Zache is thread-safe. It locks the entire cache on each get call. You turn that off by using sync argument:

zache = Zache.new(sync: false)
v = zache.get(:count) { expensive() }

You may use "dirty" mode, which will return you an expired value, while calculation is waiting. Say, you have something in the cache, but it's expired. Then, you call get with a long running block. The thread waits, while another one calls get again. That second thread won't wait, but will receive what's left in the cache. This is a very convenient mode for situations when you don't really care about data accuracy, but performance is an issue.

The entire API is documented here (there are many other convenient methods).

That's it.

How to contribute

Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:

$ bundle update
$ bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].