class CryBase::CouchBase::Services::KV::Pool

Overview

Fixed-size pool of authenticated KV clients for concurrent fibers.

Defined in:

crybase/couchbase/services/kv/pool.cr

Constant Summary

DEFAULT_SIZE = 10

Constructors

Instance Method Summary

Constructor Detail

def self.from_string(uri : String, username : String | Nil = nil, password : String | Nil = nil, bucket : String | Nil = nil, size : Int32 = DEFAULT_SIZE, connect_timeout : Time::Span = 5.seconds, *, tls_verify : Bool | Nil = nil, tls_hostname : String | Nil = nil, tls_context : OpenSSL::SSL::Context::Client | Nil = nil) : Pool #

Builds a KV endpoint from uri and opens a pool of authenticated clients for the first host in the connection string.

username, password, and #bucket may be passed explicitly or embedded as couchbase://user:pass@host/bucket. Query parameters currently supported by this helper: tls_verify and tls_hostname.

pool = KV::Pool.from_string("couchbase://user:pass@node1/default")

[View source]
def self.new(endpoint : Endpoint, username : String, password : String, bucket : String, size : Int32 = DEFAULT_SIZE, connect_timeout : Time::Span = 5.seconds, *, tls_verify : Bool = true, tls_hostname : String | Nil = nil, tls_context : OpenSSL::SSL::Context::Client | Nil = nil) #

[View source]

Instance Method Detail

def bucket : String #

[View source]
def checkout(& : Client -> T) : T forall T #

[View source]
def close : Nil #

[View source]
def closed? : Bool #

[View source]
def decrement(*args, **kwargs) #

[View source]
def delete(*args, **kwargs) #

[View source]
def endpoint : Endpoint #

[View source]
def get(*args, **kwargs) #

[View source]
def get_as(*args, **kwargs) #

[View source]
def increment(*args, **kwargs) #

[View source]
def set(*args, **kwargs) #

[View source]
def size : Int32 #

[View source]
def touch(*args, **kwargs) #

[View source]