Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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
```