All Projects β†’ hit-box β†’ hitbox

hit-box / hitbox

Licence: MIT License
A high-performance caching framework suitable for single-machine and for distributed applications in Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to hitbox

async-memo-ize
πŸ›  Memoize utility for async/await syntax and promises. It supports cache in memory or via Redis
Stars: ✭ 16 (-73.77%)
Mutual labels:  cache
type-cacheable
TypeScript-based caching decorator (currently supports Redis, LRU-Cache and NodeCache)
Stars: ✭ 96 (+57.38%)
Mutual labels:  cache
papercut
Papercut is a scraping/crawling library for Node.js built on top of JSDOM. It provides basic selector features together with features like Page Caching and Geosearch.
Stars: ✭ 15 (-75.41%)
Mutual labels:  cache
ccache-gui
macOS GUI helper for ccache
Stars: ✭ 52 (-14.75%)
Mutual labels:  cache
HAProxy-2-RPM-builder
Build latest HAProxy binary with prometheus metrics support
Stars: ✭ 28 (-54.1%)
Mutual labels:  cache
pacman.store
Pacman Mirror via IPFS for ArchLinux, Endeavouros and Manjaro
Stars: ✭ 65 (+6.56%)
Mutual labels:  cache
punic
Punic is a remote cache CLI built for Carthage and Apple .xcframework
Stars: ✭ 25 (-59.02%)
Mutual labels:  cache
component-box
A little component cacher πŸ“¦
Stars: ✭ 25 (-59.02%)
Mutual labels:  cache
resilience4clj-circuitbreaker
Resilience4Clj circuit breaker lets you decorate a function call (usually with a potential of external failure) with a safety mechanism to interrupt the propagation of failures.
Stars: ✭ 40 (-34.43%)
Mutual labels:  cache
GraphCMS-cache-boilerplate
The main goal of this service is to provide a reliable cache contingency backup plan in case a GraphCMS/GraphQL endpoint is failing.
Stars: ✭ 24 (-60.66%)
Mutual labels:  cache
proxpi
PyPI caching mirror
Stars: ✭ 19 (-68.85%)
Mutual labels:  cache
AspSqliteCache
An ASP.NET Core IDistributedCache provider backed by SQLite
Stars: ✭ 39 (-36.07%)
Mutual labels:  cache
Ccache.cmake
πŸš… Compile faster with Ccache! A Ccache integration for CMake with Xcode support.
Stars: ✭ 24 (-60.66%)
Mutual labels:  cache
cachex
CacheXζ³¨θ§£ηΌ“ε­˜ζ‘†ζžΆ
Stars: ✭ 39 (-36.07%)
Mutual labels:  cache
composer-install
A GitHub Action to streamline installation of PHP dependencies with Composer.
Stars: ✭ 151 (+147.54%)
Mutual labels:  cache
LocalCache
JAVA LocalCache -- JAVA ζœ¬εœ°ηΌ“ε­˜ε·₯ε…·η±»
Stars: ✭ 62 (+1.64%)
Mutual labels:  cache
incache
Powerful key/value in-memory storage or on disk to persist data
Stars: ✭ 16 (-73.77%)
Mutual labels:  cache
elara
Elara DB is an easy to use, lightweight key-value database that can also be used as a fast in-memory cache. Manipulate data structures in-memory, encrypt database files and export data. 🎯
Stars: ✭ 93 (+52.46%)
Mutual labels:  cache
salad
Asynchronous Scala Redis Client supporting Sentinel and Redis Cluster
Stars: ✭ 14 (-77.05%)
Mutual labels:  cache
cacheme-go
πŸš€ Schema based, typed Redis caching/memoize framework for Go
Stars: ✭ 19 (-68.85%)
Mutual labels:  cache

hitbox

Build status Coverage Status

Hitbox is an asynchronous caching framework supporting multiple backends and suitable for distributed and for single-machine applications.

Framework integrations

Features

  • Automatic cache key generation.
  • Multiple cache backend implementations:
  • Stale cache mechanics.
  • Cache locks for dogpile effect preventions.
  • Distributed cache locks.
  • Detailed metrics out of the box.

Backend implementations

  • Redis
  • In-memory backend

Feature flags

  • derive - Support for Cacheable trait derive macros.
  • metrics - Support for metrics.

Restrictions

Default cache key implementation based on serde_qs crate and have some restrictions.

Documentation

Example

Dependencies:

[dependencies]
hitbox = "0.1"

Code:

First, you should derive Cacheable trait for your struct or enum:

use hitbox::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Cacheable, Serialize)] // With features=["derive"]
struct Ping {
    id: i32,
}

Or implement that trait manually:

use hitbox::{Cacheable, CacheError};
struct Ping { id: i32 }
impl Cacheable for Ping {
    fn cache_key(&self) -> Result<String, CacheError> {
        Ok(format!("{}::{}", self.cache_key_prefix(), self.id))
    }

    fn cache_key_prefix(&self) -> String { "Ping".to_owned() }
}
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].