An open API service indexing awesome lists of open source software.

https://github.com/axiros/redis_auto_del

Automatically deletes a key when a client disconnects
https://github.com/axiros/redis_auto_del

redis redis-module

Last synced: about 2 months ago
JSON representation

Automatically deletes a key when a client disconnects

Awesome Lists containing this project

README

          

# Introduction

This is a server side [redis module](https://redis.io/topics/modules-intro).
Its use case is to automatically delete a key from redis when the corresponding
client disconnects.

# Commands

## ax.associate_key

Syntax: `ax.associate_key `

Associates an existing key with the current client session.
When the client disconnects they key gets automatically deleted.

If the key is already associated with a client, this association gets transferred
to the current client calling the command.

If the key gets deleted / expired/ evicted the association is automaticlly cleared.

*Return Values:*

* `0` if the `key` did not exist.
* `1` on success.

# Building

```
git submodule init
git submodule update
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../
make ax_redis_auto_del
```

After that, you got a file called `libax_redis_auto_del.so`.

# Installing

Install the module via adding the folling line into the redis config file:

`loadmodule /libax_redis_auto_del.so`