druse-driver

druse-driver

A Crystal client driver for Druse and Redis-compatible servers.

Features

  • TCP (redis://) and UNIX domain socket (unix://) connections
  • Connection pooling (Channel-based, fiber-safe) with read/write/connect timeouts
  • Automatic single retry on stale pooled connections (IO::Error)
  • AUTH (password or ACL username/password) and SELECT database support
  • Key-prefix routing across multiple Druse / Redis endpoints (prefix_urls), including cross-endpoint MGET / DEL fanning out and ping_all! / ping_all?
  • Typed helpers for String, Hash, Set, Sorted Set, Key, and SCAN commands

Installation

Add the dependency to your shard.yml:

dependencies:
  druse-driver:
    github: minor-mn/druse-driver

Usage

require "druse_driver"

client = DruseDriver::Client.new(
  "unix:///var/run/druse.sock",
  pool_size: 8,
  timeout: 5.seconds,
  prefix_urls: {
    "vuln:" => "unix:///var/run/druse-vuln.sock",
  }
)

client.ping_all!
client.set("greeting", "hello")
puts client.get("greeting") # => "hello"
client.close

Development

crystal spec
Repository

druse-driver

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • about 4 hours ago
  • December 4, 2026
License

Links
Synced at

Fri, 04 Dec 2026 06:23:45 GMT

Languages