https://github.com/zdharma-continuum/zservice-redis
A Zsh plugin that runs redis database server
https://github.com/zdharma-continuum/zservice-redis
Last synced: about 1 month ago
JSON representation
A Zsh plugin that runs redis database server
- Host: GitHub
- URL: https://github.com/zdharma-continuum/zservice-redis
- Owner: zdharma-continuum
- License: mit
- Created: 2021-11-06T19:23:05.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-16T03:00:56.000Z (over 3 years ago)
- Last Synced: 2025-04-08T00:09:23.104Z (over 1 year ago)
- Language: Shell
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redis
This Zsh service-plugin will run `redis-server` pointing it to configuration file `redis.conf`. This can be used with
plugin [zdharma-continuum/zredis](https://github.com/zdharma-continuum/zredis) to have the redis-backend running, to use
*shared-variables* (between shells). Bind the variables using lazy method (`-L {type}` option):
```zsh
# Port 4815, database nr. 3, key "MYLIST"
ztie -d db/redis -f "127.0.0.1:4815/3/MYLIST" -L list mylist
```
The command `ztie` is provided by [zdharma-continuum/zredis](https://github.com/zdharma-continuum/zredis) plugin.
## [zinit](https://github.com/zdharma-continuum/zinit)
A service-plugin needs a plugin manager that supports loading single plugin instance per all active Zsh sessions, in
background. zinit supports this, just add:
```zsh
zinit ice service'redis'
zinit light zservices/redis
```
to `~/.zshrc`.
## Explanation of Zsh-spawned services
First Zsh instance that will gain a lock will spawn the service. Other Zsh instances will wait. When you close the
initial Zsh session, another Zsh will gain lock and resume the service. `zdharma-continuum/zredis` supports
reconnecting, so all shared-variables will still work.