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
- Host: GitHub
- URL: https://github.com/axiros/redis_auto_del
- Owner: axiros
- License: apache-2.0
- Created: 2020-07-20T07:33:27.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-20T09:43:58.000Z (almost 6 years ago)
- Last Synced: 2025-07-21T22:00:53.562Z (12 months ago)
- Topics: redis, redis-module
- Language: C
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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`