{"id":17222957,"url":"https://github.com/rush/redis_expiremember_module","last_synced_at":"2025-04-14T00:18:28.716Z","repository":{"id":214929792,"uuid":"737705303","full_name":"Rush/redis_expiremember_module","owner":"Rush","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-14T02:54:55.000Z","size":24,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T14:21:20.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-01T06:48:30.000Z","updated_at":"2025-02-14T18:52:44.000Z","dependencies_parsed_at":"2024-01-13T09:24:02.482Z","dependency_job_id":"0bd9dab8-3432-40d6-80c7-15532afe99ac","html_url":"https://github.com/Rush/redis_expiremember_module","commit_stats":null,"previous_names":["rush/redis_expiremember_module"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fredis_expiremember_module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fredis_expiremember_module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fredis_expiremember_module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fredis_expiremember_module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rush","download_url":"https://codeload.github.com/Rush/redis_expiremember_module/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799979,"owners_count":21163404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T04:06:51.920Z","updated_at":"2025-04-14T00:18:28.682Z","avatar_url":"https://github.com/Rush.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis ExpireMember Module\n\n## Introduction\n\n`redis_expiremember_module` is a custom Redis module that introduces an `EXPIREMEMBER` command. This command allows setting expiration times on individual hash fields, a feature inspired by KeyDB's `EXPIREMEMBER`, but with some distinct differences and enhancements.\n\n## Features\n\n- **Field-Level Expiration**: Set expiration times on individual fields within a Redis hash, a Redis set and a Redis zset.\n- **Custom Expiration Units**: Support for specifying expiration times in seconds (`s`) or milliseconds (`ms`).\n- **Expiration Override**: Ability to update or override the expiration time for a specific field.\n- **Expiring runs in a separate thread**: The module has been designed to have minimal impact on Redis server's performance and locks Redis's main thread only for actual Redis key delete operations.\n\n## Key Differences from KeyDB's EXPIREMEMBER\n\n- **Independent Expiration Handling**: Unlike KeyDB, expirations set via this module are not affected by other hash operations.\n- **Explicit Expiration Removal**: Requires explicit management when manually removing hash members.\n\n## Installation\n\n1. Clone the repository.\n2. Build the module using `cargo build --release`.\n3. Load the module into your Redis server.\n\n   ```sh\n   redis-server --loadmodule ./target/release/libredis_expiremember_module.so\n   ```\n\n## Usage\n\n### Setting Expiration\n\n```redis\nEXPIREMEMBER key field time [unit]\n```\n\n- `key`: Redis hash key.\n- `field`: Field within the hash to expire.\n- `time`: Expiration time.\n- `unit` (optional): Time unit (`s` for seconds, `ms` for milliseconds). Defaults to seconds.\n\n### Overriding Expiration\n\nTo update the expiration time for a field, simply execute `EXPIREMEMBER` again with the new time.\n\n### Removing Expiration\n\nTo remove expiration from a field:\n\n```redis\nEXPIREMEMBER key field 0\n```\n\nIf you manually delete a field using `HDEL`, make sure to also remove its expiration.\n\n## Example\n\n```redis\nHSET myhash field1 value1\nEXPIREMEMBER myhash field1 10\n```\n\nSets `field1` in `myhash` to expire in 10 seconds.\n\nOR\n\n```redis\nSADD myset member1 \nEXPIREMEMBER myset member1 10\n```\n\nOR\n\n```redis\nZADD myzset member1 \nEXPIREMEMBER myzset member1 10\n```\n\nSets `field` members in `myset` to expire in 10 seconds\n\n\n## Development\n\n### Dependencies\n\n- Rust\n- Cargo (Rust's package manager)\n- Redis (for running tests)\n\n### Building\n\nRun `cargo build` to compile the project.\n\nRun `./build-production.sh` to compile via Docker to build a production-candidate shared library.\n\nRun `./build-redis.sh` to build a Redis server container with this module enabled. Published at: https://hub.docker.com/r/rushpl/redis-expiremember\n\n\n### Testing\n\nTests are available under the `tests` module. Run them using `cargo test`. This will start a server using the `redis-server` binary.\n\nYou can also override the binary, see example below:\n```\nREDIS_SERVER_BIN=/sbin/redis-server cargo test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frush%2Fredis_expiremember_module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frush%2Fredis_expiremember_module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frush%2Fredis_expiremember_module/lists"}