All Projects → luizalabs → Shared Memory Dict

luizalabs / Shared Memory Dict

Licence: mit
A very simple shared memory dict implementation

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Shared Memory Dict

React Weather App
⛅️ A weather app built with React.
Stars: ✭ 21 (-25%)
Mutual labels:  hacktoberfest
Pi Hole
A black hole for Internet advertisements
Stars: ✭ 34,076 (+121600%)
Mutual labels:  hacktoberfest
Uwp bridge java
Skeleton for packing Java applications for publishing them on Windows Store
Stars: ✭ 27 (-3.57%)
Mutual labels:  hacktoberfest
Magma
Platform for building access networks and modular network services
Stars: ✭ 913 (+3160.71%)
Mutual labels:  hacktoberfest
Rocket.chat
The communications platform that puts data protection first.
Stars: ✭ 31,251 (+111510.71%)
Mutual labels:  hacktoberfest
Fastlane
🚀 The easiest way to automate building and releasing your iOS and Android apps
Stars: ✭ 33,382 (+119121.43%)
Mutual labels:  hacktoberfest
Postgresql Postgis Timescaledb
PostgreSQL + PostGIS + TimescaleDB docker image 🐘🌎📈
Stars: ✭ 19 (-32.14%)
Mutual labels:  hacktoberfest
Opencast Docker
Dockerfiles for Opencast
Stars: ✭ 27 (-3.57%)
Mutual labels:  hacktoberfest
Vuetify
🐉 Material Component Framework for Vue
Stars: ✭ 33,085 (+118060.71%)
Mutual labels:  hacktoberfest
Julia
The Julia Programming Language
Stars: ✭ 37,497 (+133817.86%)
Mutual labels:  hacktoberfest
Blog Post Workflow
Show your latest blog posts from any sources or StackOverflow activity or Youtube Videos on your GitHub profile/project readme automatically using the RSS feed
Stars: ✭ 910 (+3150%)
Mutual labels:  hacktoberfest
Sentry
Sentry is cross-platform application monitoring, with a focus on error reporting.
Stars: ✭ 29,700 (+105971.43%)
Mutual labels:  hacktoberfest
Hackathon Starter
A boilerplate for Node.js web applications
Stars: ✭ 32,485 (+115917.86%)
Mutual labels:  hacktoberfest
Ktx
LibKTX: Kotlin extensions for LibGDX games and applications
Stars: ✭ 913 (+3160.71%)
Mutual labels:  hacktoberfest
Conjugar
Conjugar is an app for learning Spanish verb conjugations.
Stars: ✭ 27 (-3.57%)
Mutual labels:  hacktoberfest
Kamekazi
Self destructing messages
Stars: ✭ 21 (-25%)
Mutual labels:  hacktoberfest
Tldr
📚 Collaborative cheatsheets for console commands
Stars: ✭ 36,408 (+129928.57%)
Mutual labels:  hacktoberfest
Markdown
A super fast, highly extensible markdown parser for PHP
Stars: ✭ 945 (+3275%)
Mutual labels:  hacktoberfest
Mvvm C Templates
Templates for MVVM-C architecture
Stars: ✭ 27 (-3.57%)
Mutual labels:  hacktoberfest
Definitelytyped
The repository for high quality TypeScript type definitions.
Stars: ✭ 37,066 (+132278.57%)
Mutual labels:  hacktoberfest

Shared Memory Dict

A very simple shared memory dict implementation.

Requires: Python >= 3.8

>> from shared_memory_dict import SharedMemoryDict
>> smd = SharedMemoryDict(name='tokens', size=1024)
>> smd['some-key'] = 'some-value-with-any-type'
>> smd['some-key']
'some-value-with-any-type'

The arg name defines the location of the memory block, so if you want to share the memory between process use the same name

Installation

Using pip:

pip install shared-memory-dict

Locks

To use multiprocessing.Lock on write operations of shared memory dict set environment variable SHARED_MEMORY_USE_LOCK=1.

Django Cache Implementation

There's a Django Cache Implementation with Shared Memory Dict:

# settings/base.py
CACHES = {
    'default': {
        'BACKEND': 'shared_memory_dict.caches.django.SharedMemoryCache',
        'LOCATION': 'memory',
        'OPTIONS': {'MEMORY_BLOCK_SIZE': 1024}
    }
}

Install with: pip install "shared-memory-dict[django]"

Caveat

With Django cache implementation the keys only expire when they're read. Be careful with memory usage

AioCache Backend

There's also a AioCache Backend Implementation with Shared Memory Dict:

From aiocache import caches

caches.set_config({
    'default': {
        'cache': 'shared_memory_dict.caches.aiocache.SharedMemoryCache',
        'size': 1024,
    },
})

This implementation is very based on aiocache SimpleMemoryCache

Install with: pip install "shared-memory-dict[aiocache]"

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].