Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

SSPkrolik/asyncredis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asyncredis

Asynchronous Redis client for Nim that uses Nim asyncdispatch Nim's asyncronous I/O tooling. The client impements connection pool exactly the same way as nimongo does.

Installation

$ nimble install https://github.com/SSPkrolik/asyncredis.git

Usage

First, create asynchronous Redis client, and perform connections establishment. All connections from pool try to connect to Redis server.

import asyncredis

let ar = newAsyncRedis("localhost", poolSize=1)
discard waitFor(ar.connect())

Asynchronous Redis client performs automated reconnection if disconnection happened during certain command execution.

proc makeGetSet(): Future[string] {.async.} =
    discard await ar.SET("key", "value")
    let val = await ar.GET("key")
    return val

let res = waitFor(makeGetSet)
echo res

Implementation Status

Command Status Notes
APPEND
AUTH
BGREWRITEAOF
BGSAVE
BITCOUNT
BITFIELD 🔴
BITOP
BITPOS 🔴
BLPOP 🔴
BRPOP 🔴
BRPOPLPUSH 🔴
CLIENT GETNAME
CLIENT KILL
CLIENT LIST
CLIENT PAUSE
CLIENT REPLY
CLIENT SETNAME
COMMAND 🔴
COMMAND COUNT
DBSIZE
DEBUG OBJECT
DEBUG SEGFAULT
DECR
DECRBY
DEL
DISCARD Transaction
DUMP
ECHO
FLUSHALL
FLUSHDB
GET
KEYS
INCR
INCRBY
INCRBYFLOAT
LASTSAVE
LPUSH
LPUSHX
LRANGE
PING
SET No TTL
TIME
TTL
TYPE

About

Asynchronous Redis client for Nim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages