module NATS::KV

Overview

NATS::KV is an experimental interface to the NATS server's experimental KV feature.

To use KV:

require "nats/kv"

nats = NATS::Client.new
kv = nats.kv

bucket = "my-bucket"
kv.create_bucket(bucket)
kv.put bucket, "key", "value"

msg = kv.get(bucket, "key").try(&.value)
String.new(msg.data) # => "value"
msg.seq              # => 1

EXPERIMENTAL NATS KV support is experimental and subject to change as NATS support for it changes

Defined in:

kv.cr