Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soveran/resp-crystal
Lightweight RESP client
https://github.com/soveran/resp-crystal
Last synced: 4 days ago
JSON representation
Lightweight RESP client
- Host: GitHub
- URL: https://github.com/soveran/resp-crystal
- Owner: soveran
- License: mit
- Created: 2016-04-15T11:57:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-10T09:28:18.000Z (almost 3 years ago)
- Last Synced: 2024-08-01T17:35:43.037Z (3 months ago)
- Language: Crystal
- Size: 16.6 KB
- Stars: 15
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - resp-crystal - Lightweight RESP client (HTTP)
- awesome-crystal - resp-crystal - Lightweight RESP client (HTTP)
README
# Resp
Lightweight [RESP](http://redis.io/topics/protocol) client that
can be used for interacting with Redis and Disque servers.![CI](https://github.com/soveran/resp-crystal/workflows/Crystal%20CI/badge.svg)
## Usage
```crystal
require "resp"client = Resp.new("redis://localhost:6379")
client.call("SET", "foo", "42")
client.call("GET", "foo") #=> "42"
```## Pipelining
You can pipeline commands by using the `queue`/`commit` methods.
```crystal
require "resp"client = Resp.new("redis://localhost:6379")
client.queue("ECHO", "foo")
client.queue("ECHO", "bar")client.commit #=> ["foo", "bar"]
```## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
resp:
github: soveran/resp-crystal
branch: master
```