Module
Module documentation.
moduleaio.redis
Classes
Classes and inheritance.
classaio.redis::Message
@brief`Message` type.
@details`Message` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Message {
/*
@brief `kind` field.classaio.redis::ResultList
@brief`ResultList` type.
@details`ResultList` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class ResultList {
/*
@brief `values` field.classaio.redis::Conn
@brief`Conn` type.
@details`Conn` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Conn {
/*
@brief `fd` field.classaio.redis::Pipeline
@brief`Pipeline` type.
@details`Pipeline` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Pipeline {
/*
@brief `conn` field.classaio.redis::Subscriber
@brief`Subscriber` type.
@details`Subscriber` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Subscriber {
/*
@brief `conn` field.classaio.redis::Pool
@brief`Pool` type.
@details`Pool` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Pool {
/*
@brief `cfg` field.classaio.redis::SlotRange
@brief`SlotRange` type.
@details`SlotRange` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class SlotRange {
/*
@brief `start_slot` field.classaio.redis::ClusterClient
@brief`ClusterClient` type.
@details`ClusterClient` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class ClusterClient {
/*
@brief `cfg` field.classaio.redis::SentinelConfig
@brief`SentinelConfig` type.
@details`SentinelConfig` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class SentinelConfig {
/*
@brief `sentinels` field.classaio.redis::SentinelClient
@brief`SentinelClient` type.
@details`SentinelClient` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class SentinelClient {
/*
@brief `cfg` field.Functions
Free functions and class methods.
functionaio.redis::Message.init
Signature
func init(self: aio.redis.Message) -> Void func init(self: aio.redis.Message) -> Void {
self.kind = "";
self.channel = "";@briefInitializes a `Message` instance.
@detailsEstablishes the initial field state for `Message` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::Message.deinit
Signature
func deinit(self: aio.redis.Message) -> Void func deinit(self: aio.redis.Message) -> Void {
}
}@briefReleases fallback resources at the end of the `Message` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::ResultList.init
Signature
func init(self: aio.redis.ResultList) -> Void func init(self: aio.redis.ResultList) -> Void {
self.values = new collections.Vector<protocol.redis.RespValue>();
}@briefInitializes a `ResultList` instance.
@detailsEstablishes the initial field state for `ResultList` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::ResultList.len
Signature
func len(self: aio.redis.ResultList) -> Int func len(self: aio.redis.ResultList) -> Int {
return self.values.len();
}@briefReturns the element count or byte length with `ResultList.len`.
@detailsExecutes the `len` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns the operation result as `Int`.
functionaio.redis::ResultList.get
Signature
func get(self: aio.redis.ResultList, idx: Int) -> protocol.redis.RespValue func get(self: aio.redis.ResultList, idx: Int) -> protocol.redis.RespValue {
return self.values.get_unchecked(idx);
}@briefReads the element for `ResultList.get`.
@detailsExecutes the `get` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- idxZero-based index.
@returnReturns the operation result as `protocol.redis.RespValue`.
functionaio.redis::ResultList.push
Signature
func push(self: aio.redis.ResultList, value: protocol.redis.RespValue) -> Void func push(self: aio.redis.ResultList, value: protocol.redis.RespValue) -> Void {
_ = self.values.push(value);
}@briefAppends an element with `ResultList.push`.
@detailsExecutes the `push` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- valueValue to write or store.
@returnVoid
functionaio.redis::ResultList.append_from_resp
Signature
func append_from_resp(self: aio.redis.ResultList, value: protocol.redis.RespValue) -> ErrCode func append_from_resp(self: aio.redis.ResultList, value: protocol.redis.RespValue) -> ErrCode {
if value.kind != protocol.redis.RESP_ARRAY && value.kind != protocol.redis.RESP_SET && value.kind != protocol.redis.RESP_PUSH {
return std.ERR_INVALID;@briefProvides the system library operation `ResultList.append_from_resp`.
@detailsExecutes the `append_from_resp` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- valueValue to write or store.
@returnReturns `ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionaio.redis::ResultList.deinit
Signature
func deinit(self: aio.redis.ResultList) -> Void func deinit(self: aio.redis.ResultList) -> Void {
}
}@briefReleases fallback resources at the end of the `ResultList` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::Conn.init
Signature
func init(self: aio.redis.Conn, fd: Int, timeout_ms: Int = 5000) -> Void func init(self: aio.redis.Conn, fd: Int, timeout_ms: Int = 5000) -> Void {
self.fd = fd;
self.tls_h = 0;@briefInitializes a `Conn` instance.
@detailsEstablishes the initial field state for `Conn` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- fdOperating-system file descriptor or socket descriptor.
- timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.redis::Conn.set_timeouts
Signature
func set_timeouts(self: aio.redis.Conn, read_timeout_ms: Int, write_timeout_ms: Int) -> Void func set_timeouts(self: aio.redis.Conn, read_timeout_ms: Int, write_timeout_ms: Int) -> Void {
self.read_timeout_ms = read_timeout_ms;
self.write_timeout_ms = write_timeout_ms;@briefSets state or configuration with `Conn.set_timeouts`.
@detailsExecutes the `set_timeouts` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- read_timeout_msTime interval or timeout value in milliseconds.
- write_timeout_msTime interval or timeout value in milliseconds.
@returnVoid
functionaio.redis::Conn.clear_error
Signature
func clear_error(self: aio.redis.Conn) -> Void func clear_error(self: aio.redis.Conn) -> Void {
self.last_error = new protocol.redis.RedisError();
}@briefProvides the system library operation `Conn.clear_error`.
@detailsExecutes the `clear_error` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::Conn.pipeline
Signature
func pipeline(self: aio.redis.Conn) -> aio.redis.Pipeline func pipeline(self: aio.redis.Conn) -> aio.redis.Pipeline {
return new aio.redis.Pipeline(self);
}@briefProvides the system library operation `Conn.pipeline`.
@detailsExecutes the `pipeline` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns the operation result as `aio.redis.Pipeline`.
functionaio.redis::Conn.close
Signature
func close(self: aio.redis.Conn) -> Void func close(self: aio.redis.Conn) -> Void {
if self.closed {
return;@briefCloses resources and makes later operations unavailable with `Conn.close`.
@detailsExecutes the `close` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::Conn.deinit
Signature
func deinit(self: aio.redis.Conn) -> Void func deinit(self: aio.redis.Conn) -> Void {
}
}@briefReleases fallback resources at the end of the `Conn` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::Pipeline.init
Signature
func init(self: aio.redis.Pipeline, conn: aio.redis.Conn) -> Void func init(self: aio.redis.Pipeline, conn: aio.redis.Conn) -> Void {
self.conn = conn;
self.commands = new collections.Vector<collections.Vector<String> >();@briefInitializes a `Pipeline` instance.
@detailsEstablishes the initial field state for `Pipeline` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- connConnection object or native connection handle used for network I/O.
@returnVoid
functionaio.redis::Pipeline.add
Signature
func add(self: aio.redis.Pipeline, args: collections.Vector<String>) -> Void func add(self: aio.redis.Pipeline, args: collections.Vector<String>) -> Void {
_ = self.commands.push(args);
}@briefProvides the system library operation `Pipeline.add`.
@detailsExecutes the `add` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- argsArgument list forwarded to the command, process, callback, or formatter.
@returnVoid
functionaio.redis::Pipeline.deinit
Signature
func deinit(self: aio.redis.Pipeline) -> Void func deinit(self: aio.redis.Pipeline) -> Void {
}
}@briefReleases fallback resources at the end of the `Pipeline` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::Subscriber.init
Signature
func init(self: aio.redis.Subscriber, conn: aio.redis.Conn) -> Void func init(self: aio.redis.Subscriber, conn: aio.redis.Conn) -> Void {
self.conn = conn;
self.conn.in_pubsub = true;@briefInitializes a `Subscriber` instance.
@detailsEstablishes the initial field state for `Subscriber` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- connConnection object or native connection handle used for network I/O.
@returnVoid
functionaio.redis::Subscriber.close
Signature
func close(self: aio.redis.Subscriber) -> Void func close(self: aio.redis.Subscriber) -> Void {
_ = self.conn.close();
}@briefCloses resources and makes later operations unavailable with `Subscriber.close`.
@detailsExecutes the `close` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::Subscriber.deinit
Signature
func deinit(self: aio.redis.Subscriber) -> Void func deinit(self: aio.redis.Subscriber) -> Void {
}
}@briefReleases fallback resources at the end of the `Subscriber` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::Pool.init
Signature
func init(self: aio.redis.Pool, cfg: protocol.redis.Config, max_size: Int = 8) -> Void func init(self: aio.redis.Pool, cfg: protocol.redis.Config, max_size: Int = 8) -> Void {
self.cfg = cfg;
self.max_size = max_size;@briefInitializes a `Pool` instance.
@detailsEstablishes the initial field state for `Pool` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- cfgConfiguration value or pointer used to initialize or control the operation.
- max_sizeMaximum allowed count or byte size.
@returnVoid
functionaio.redis::Pool.configure
Signature
func configure(self: aio.redis.Pool, acquire_timeout_ms: Int = 15000, max_idle_ms: Int = 300000, max_lifetime_ms: Int = 1800000, health_check_on_get: Bool = false, leak_threshold_ms: Int = 60000) -> Void func configure(self: aio.redis.Pool, acquire_timeout_ms: Int = 15000, max_idle_ms: Int = 300000, max_lifetime_ms: Int = 1800000, health_check_on_get: Bool = false, leak_threshold_ms: Int = 60000) -> Void {
self.acquire_timeout_ms = acquire_timeout_ms;
self.max_idle_ms = max_idle_ms;@briefProvides the system library operation `Pool.configure`.
@detailsExecutes the `configure` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- acquire_timeout_msTime interval or timeout value in milliseconds.
- max_idle_msMaximum allowed count or byte size.
- max_lifetime_msMaximum allowed count or byte size.
- health_check_on_getWhether a health check is performed when borrowing a connection.
- leak_threshold_msTime interval or timeout value in milliseconds.
@returnVoid
functionaio.redis::Pool.should_discard
Signature
func should_discard(self: aio.redis.Pool, conn: aio.redis.Conn, now_ms: Int) -> Bool func should_discard(self: aio.redis.Pool, conn: aio.redis.Conn, now_ms: Int) -> Bool {
if conn.closed || conn.broken || self.max_lifetime_ms > 0 && conn.created_at_ms > 0 && now_ms - conn.created_at_ms >= self.max_lifetime_ms || self.max_idle_ms > 0 && conn.last_used_at_ms > 0 && now_ms - conn.last_used_at_ms >= self.max_idle_ms {
return true;@briefProvides the system library operation `Pool.should_discard`.
@detailsExecutes the `should_discard` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- connConnection object or native connection handle used for network I/O.
- now_msTime interval or timeout value in milliseconds.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionaio.redis::Pool.mark_leak_if_needed
Signature
func mark_leak_if_needed(self: aio.redis.Pool, now_ms: Int) -> Void func mark_leak_if_needed(self: aio.redis.Pool, now_ms: Int) -> Void {
if self.leak_threshold_ms <= 0 || self.oldest_borrowed_at_ms <= 0 {
return;@briefProvides the system library operation `Pool.mark_leak_if_needed`.
@detailsExecutes the `mark_leak_if_needed` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- now_msTime interval or timeout value in milliseconds.
@returnVoid
functionaio.redis::Pool.idle_count
Signature
func idle_count(self: aio.redis.Pool) -> Int func idle_count(self: aio.redis.Pool) -> Int {
_ = self.mu.lock();
let n: Int = self.idle.len();@briefProvides the system library operation `Pool.idle_count`.
@detailsExecutes the `idle_count` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns the operation result as `Int`.
functionaio.redis::Pool.active_count
Signature
func active_count(self: aio.redis.Pool) -> Int func active_count(self: aio.redis.Pool) -> Int {
_ = self.mu.lock();
let n: Int = self.in_use;@briefProvides the system library operation `Pool.active_count`.
@detailsExecutes the `active_count` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns the operation result as `Int`.
functionaio.redis::Pool.close
Signature
func close(self: aio.redis.Pool) -> Void func close(self: aio.redis.Pool) -> Void {
_ = self.mu.lock();
self.closed = true;@briefCloses resources and makes later operations unavailable with `Pool.close`.
@detailsExecutes the `close` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::Pool.deinit
Signature
func deinit(self: aio.redis.Pool) -> Void func deinit(self: aio.redis.Pool) -> Void {
}
}@briefReleases fallback resources at the end of the `Pool` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::SlotRange.init
Signature
func init(self: aio.redis.SlotRange, start_slot: Int = 0, end_slot: Int = 0, host: String = "", port: Int = 6379) -> Void func init(self: aio.redis.SlotRange, start_slot: Int = 0, end_slot: Int = 0, host: String = "", port: Int = 6379) -> Void {
self.start_slot = start_slot;
self.end_slot = end_slot;@briefInitializes a `SlotRange` instance.
@detailsEstablishes the initial field state for `SlotRange` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- start_slotFirst hash slot included in the requested slot range.
- end_slotLast hash slot included in the requested slot range.
- hostHost name or listen address.
- portPort number.
@returnVoid
functionaio.redis::SlotRange.contains
Signature
func contains(self: aio.redis.SlotRange, slot: Int) -> Bool func contains(self: aio.redis.SlotRange, slot: Int) -> Bool {
return slot >= self.start_slot && slot <= self.end_slot;
}@briefProvides the system library operation `SlotRange.contains`.
@detailsExecutes the `contains` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- slotHash slot or storage slot selected by the operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionaio.redis::SlotRange.deinit
Signature
func deinit(self: aio.redis.SlotRange) -> Void func deinit(self: aio.redis.SlotRange) -> Void {
}
}@briefReleases fallback resources at the end of the `SlotRange` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::ClusterClient.init
Signature
func init(self: aio.redis.ClusterClient, cfg: protocol.redis.Config) -> Void func init(self: aio.redis.ClusterClient, cfg: protocol.redis.Config) -> Void {
self.cfg = cfg;
self.slots = new collections.Vector<aio.redis.SlotRange>();@briefInitializes a `ClusterClient` instance.
@detailsEstablishes the initial field state for `ClusterClient` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- cfgConfiguration value or pointer used to initialize or control the operation.
@returnVoid
functionaio.redis::ClusterClient.node_for_slot
Signature
func node_for_slot(self: aio.redis.ClusterClient, slot: Int) -> aio.redis.SlotRange func node_for_slot(self: aio.redis.ClusterClient, slot: Int) -> aio.redis.SlotRange {
loop (let i: Int = 0; i < self.slots.len(); i += 1) {
let r: aio.redis.SlotRange = self.slots.get_unchecked(i);@briefProvides the system library operation `ClusterClient.node_for_slot`.
@detailsExecutes the `node_for_slot` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- slotHash slot or storage slot selected by the operation.
@returnReturns the operation result as `aio.redis.SlotRange`.
functionaio.redis::ClusterClient.deinit
Signature
func deinit(self: aio.redis.ClusterClient) -> Void func deinit(self: aio.redis.ClusterClient) -> Void {
}
}@briefReleases fallback resources at the end of the `ClusterClient` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::SentinelConfig.init
Signature
func init(self: aio.redis.SentinelConfig) -> Void func init(self: aio.redis.SentinelConfig) -> Void {
self.sentinels = new collections.Vector<String>();
self.master_name = "mymaster";@briefInitializes a `SentinelConfig` instance.
@detailsEstablishes the initial field state for `SentinelConfig` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::SentinelConfig.deinit
Signature
func deinit(self: aio.redis.SentinelConfig) -> Void func deinit(self: aio.redis.SentinelConfig) -> Void {
}
}@briefReleases fallback resources at the end of the `SentinelConfig` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.redis::SentinelClient.init
Signature
func init(self: aio.redis.SentinelClient, cfg: aio.redis.SentinelConfig) -> Void func init(self: aio.redis.SentinelClient, cfg: aio.redis.SentinelConfig) -> Void {
self.cfg = cfg;
}@briefInitializes a `SentinelClient` instance.
@detailsEstablishes the initial field state for `SentinelClient` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- cfgConfiguration value or pointer used to initialize or control the operation.
@returnVoid
functionaio.redis::SentinelClient.deinit
Signature
func deinit(self: aio.redis.SentinelClient) -> Void func deinit(self: aio.redis.SentinelClient) -> Void {
}
}@briefReleases fallback resources at the end of the `SentinelClient` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
Variables
Class fields (var).
varaio.redis::Message.kind
Type
String@brief`kind` field.
@detailsHolds the `kind` value for each `Message` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
var kind: String;
/*
@brief `channel` field.varaio.redis::Message.channel
Type
String@brief`channel` field.
@detailsHolds the `channel` value for each `Message` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
var channel: String;
/*
@brief `pattern` field.varaio.redis::Message.pattern
Type
String@brief`pattern` field.
@detailsHolds the `pattern` value for each `Message` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
var pattern: String;
/*
@brief `payload` field.varaio.redis::Message.payload
Type
String@brief`payload` field.
@detailsHolds the `payload` value for each `Message` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
var payload: String;
/*
@brief `raw` field.varaio.redis::Message.raw
Type
protocol.redis.RespValue@brief`raw` field.
@detailsHolds the `raw` value for each `Message` instance. The field type is `protocol.redis.RespValue`, and constructors and methods keep it synchronized with the object's runtime state.
var raw: protocol.redis.RespValue;
/*varaio.redis::ResultList.values
Type
collections.Vector<protocol.redis.RespValue>@brief`values` field.
@detailsHolds the `values` value for each `ResultList` instance. The field type is `collections.Vector<protocol.redis.RespValue>`, and constructors and methods keep it synchronized with the object's runtime state.
var values: collections.Vector<protocol.redis.RespValue>;
/*varaio.redis::Conn.fd
Type
Int@brief`fd` field.
@detailsStores the underlying file descriptor or socket descriptor. The field type is `Int`, and it is maintained by the constructors and methods of `Conn`.
var fd: Int;
/*
@brief `tls_h` field.varaio.redis::Conn.tls_h
Type
Int@brief`tls_h` field.
@detailsHolds the `tls_h` value for each `Conn` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var tls_h: Int;
/*
@brief `tls_enabled` field.varaio.redis::Conn.tls_enabled
Type
Bool@brief`tls_enabled` field.
@detailsHolds the `tls_enabled` value for each `Conn` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
var tls_enabled: Bool;
/*
@brief `timeout_ms` field.varaio.redis::Conn.timeout_ms
Type
Int@brief`timeout_ms` field.
@detailsStores the default timeout in milliseconds. The field type is `Int`, and it is maintained by the constructors and methods of `Conn`.
var timeout_ms: Int;
/*
@brief `read_timeout_ms` field.varaio.redis::Conn.read_timeout_ms
Type
Int@brief`read_timeout_ms` field.
@detailsHolds the `read_timeout_ms` value for each `Conn` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var read_timeout_ms: Int;
/*
@brief `write_timeout_ms` field.varaio.redis::Conn.write_timeout_ms
Type
Int@brief`write_timeout_ms` field.
@detailsHolds the `write_timeout_ms` value for each `Conn` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var write_timeout_ms: Int;
/*
@brief `closed` field.varaio.redis::Conn.closed
Type
Bool@brief`closed` field.
@detailsIndicates whether the resource has already been closed. The field type is `Bool`, and it is maintained by the constructors and methods of `Conn`.
var closed: Bool;
/*
@brief `broken` field.varaio.redis::Conn.broken
Type
Bool@brief`broken` field.
@detailsHolds the `broken` value for each `Conn` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
var broken: Bool;
/*
@brief `in_pubsub` field.varaio.redis::Conn.in_pubsub
Type
Bool@brief`in_pubsub` field.
@detailsHolds the `in_pubsub` value for each `Conn` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
var in_pubsub: Bool;
/*
@brief `reader` field.varaio.redis::Conn.reader
Type
protocol.redis.Reader@brief`reader` field.
@detailsHolds the `reader` value for each `Conn` instance. The field type is `protocol.redis.Reader`, and constructors and methods keep it synchronized with the object's runtime state.
var reader: protocol.redis.Reader;
/*
@brief `last_error` field.varaio.redis::Conn.last_error
Type
protocol.redis.RedisError@brief`last_error` field.
@detailsHolds the `last_error` value for each `Conn` instance. The field type is `protocol.redis.RedisError`, and constructors and methods keep it synchronized with the object's runtime state.
var last_error: protocol.redis.RedisError;
/*
@brief `created_at_ms` field.varaio.redis::Conn.created_at_ms
Type
Int@brief`created_at_ms` field.
@detailsHolds the `created_at_ms` value for each `Conn` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var created_at_ms: Int;
/*
@brief `last_used_at_ms` field.varaio.redis::Conn.last_used_at_ms
Type
Int@brief`last_used_at_ms` field.
@detailsHolds the `last_used_at_ms` value for each `Conn` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var last_used_at_ms: Int;
/*
@brief `borrowed_at_ms` field.varaio.redis::Conn.borrowed_at_ms
Type
Int@brief`borrowed_at_ms` field.
@detailsHolds the `borrowed_at_ms` value for each `Conn` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var borrowed_at_ms: Int;
/*
@brief `use_count` field.varaio.redis::Conn.use_count
Type
Int@brief`use_count` field.
@detailsHolds the `use_count` value for each `Conn` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var use_count: Int;
/*varaio.redis::Pipeline.conn
Type
aio.redis.Conn@brief`conn` field.
@detailsHolds the `conn` value for each `Pipeline` instance. The field type is `aio.redis.Conn`, and constructors and methods keep it synchronized with the object's runtime state.
var conn: aio.redis.Conn;
/*
@brief `commands` field.varaio.redis::Pipeline.commands
Type
collections.Vector<collections.Vector<String> >@brief`commands` field.
@detailsHolds the `commands` value for each `Pipeline` instance. The field type is `collections.Vector<collections.Vector<String> >`, and constructors and methods keep it synchronized with the object's runtime state.
var commands: collections.Vector<collections.Vector<String> >;
/*varaio.redis::Subscriber.conn
Type
aio.redis.Conn@brief`conn` field.
@detailsHolds the `conn` value for each `Subscriber` instance. The field type is `aio.redis.Conn`, and constructors and methods keep it synchronized with the object's runtime state.
var conn: aio.redis.Conn;
/*
@brief `commands` field.varaio.redis::Pool.cfg
Type
protocol.redis.Config@brief`cfg` field.
@detailsHolds the `cfg` value for each `Pool` instance. The field type is `protocol.redis.Config`, and constructors and methods keep it synchronized with the object's runtime state.
var cfg: protocol.redis.Config;
/*
@brief `max_size` field.varaio.redis::Pool.max_size
Type
Int@brief`max_size` field.
@detailsHolds the `max_size` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var max_size: Int;
/*
@brief `idle` field.varaio.redis::Pool.idle
Type
collections.Vector<aio.redis.Conn>@brief`idle` field.
@detailsHolds the `idle` value for each `Pool` instance. The field type is `collections.Vector<aio.redis.Conn>`, and constructors and methods keep it synchronized with the object's runtime state.
var idle: collections.Vector<aio.redis.Conn>;
/*
@brief `mu` field.varaio.redis::Pool.mu
Type
sync.Mutex@brief`mu` field.
@detailsHolds the `mu` value for each `Pool` instance. The field type is `sync.Mutex`, and constructors and methods keep it synchronized with the object's runtime state.
var mu: sync.Mutex;
/*
@brief `total` field.varaio.redis::Pool.total
Type
Int@brief`total` field.
@detailsHolds the `total` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var total: Int;
/*
@brief `in_use` field.varaio.redis::Pool.in_use
Type
Int@brief`in_use` field.
@detailsHolds the `in_use` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var in_use: Int;
/*
@brief `waiters` field.varaio.redis::Pool.waiters
Type
Int@brief`waiters` field.
@detailsHolds the `waiters` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var waiters: Int;
/*
@brief `closed` field.varaio.redis::Pool.closed
Type
Bool@brief`closed` field.
@detailsIndicates whether the resource has already been closed. The field type is `Bool`, and it is maintained by the constructors and methods of `Pool`.
var closed: Bool;
/*
@brief `broken` field.varaio.redis::Pool.acquire_timeout_ms
Type
Int@brief`acquire_timeout_ms` field.
@detailsHolds the `acquire_timeout_ms` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var acquire_timeout_ms: Int;
/*
@brief `max_idle_ms` field.varaio.redis::Pool.max_idle_ms
Type
Int@brief`max_idle_ms` field.
@detailsHolds the `max_idle_ms` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var max_idle_ms: Int;
/*
@brief `max_lifetime_ms` field.varaio.redis::Pool.max_lifetime_ms
Type
Int@brief`max_lifetime_ms` field.
@detailsHolds the `max_lifetime_ms` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var max_lifetime_ms: Int;
/*
@brief `health_check_on_get` field.varaio.redis::Pool.health_check_on_get
Type
Bool@brief`health_check_on_get` field.
@detailsHolds the `health_check_on_get` value for each `Pool` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
var health_check_on_get: Bool;
/*
@brief `leak_threshold_ms` field.varaio.redis::Pool.leak_threshold_ms
Type
Int@brief`leak_threshold_ms` field.
@detailsHolds the `leak_threshold_ms` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var leak_threshold_ms: Int;
/*
@brief `leak_reports` field.varaio.redis::Pool.leak_reports
Type
Int@brief`leak_reports` field.
@detailsHolds the `leak_reports` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var leak_reports: Int;
/*
@brief `oldest_borrowed_at_ms` field.varaio.redis::Pool.oldest_borrowed_at_ms
Type
Int@brief`oldest_borrowed_at_ms` field.
@detailsHolds the `oldest_borrowed_at_ms` value for each `Pool` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var oldest_borrowed_at_ms: Int;
/*varaio.redis::SlotRange.start_slot
Type
Int@brief`start_slot` field.
@detailsHolds the `start_slot` value for each `SlotRange` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var start_slot: Int;
/*
@brief `end_slot` field.varaio.redis::SlotRange.end_slot
Type
Int@brief`end_slot` field.
@detailsHolds the `end_slot` value for each `SlotRange` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var end_slot: Int;
/*
@brief `host` field.varaio.redis::SlotRange.host
Type
String@brief`host` field.
@detailsStores a host name or network address. The field type is `String`, and it is maintained by the constructors and methods of `SlotRange`.
var host: String;
/*
@brief `port` field.varaio.redis::SlotRange.port
Type
Int@brief`port` field.
@detailsStores a port number. The field type is `Int`, and it is maintained by the constructors and methods of `SlotRange`.
var port: Int;
/*varaio.redis::ClusterClient.cfg
Type
protocol.redis.Config@brief`cfg` field.
@detailsHolds the `cfg` value for each `ClusterClient` instance. The field type is `protocol.redis.Config`, and constructors and methods keep it synchronized with the object's runtime state.
var cfg: protocol.redis.Config;
/*
@brief `max_size` field.varaio.redis::ClusterClient.slots
Type
collections.Vector<aio.redis.SlotRange>@brief`slots` field.
@detailsHolds the `slots` value for each `ClusterClient` instance. The field type is `collections.Vector<aio.redis.SlotRange>`, and constructors and methods keep it synchronized with the object's runtime state.
var slots: collections.Vector<aio.redis.SlotRange>;
/*
@brief `max_redirects` field.varaio.redis::ClusterClient.max_redirects
Type
Int@brief`max_redirects` field.
@detailsHolds the `max_redirects` value for each `ClusterClient` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
var max_redirects: Int;
/*varaio.redis::SentinelConfig.sentinels
Type
collections.Vector<String>@brief`sentinels` field.
@detailsHolds the `sentinels` value for each `SentinelConfig` instance. The field type is `collections.Vector<String>`, and constructors and methods keep it synchronized with the object's runtime state.
var sentinels: collections.Vector<String>;
/*
@brief `master_name` field.varaio.redis::SentinelConfig.master_name
Type
String@brief`master_name` field.
@detailsHolds the `master_name` value for each `SentinelConfig` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
var master_name: String;
/*
@brief `username` field.varaio.redis::SentinelConfig.username
Type
String@brief`username` field.
@detailsHolds the `username` value for each `SentinelConfig` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
var username: String;
/*
@brief `password` field.varaio.redis::SentinelConfig.password
Type
String@brief`password` field.
@detailsHolds the `password` value for each `SentinelConfig` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
var password: String;
/*
@brief `timeout_ms` field.varaio.redis::SentinelConfig.timeout_ms
Type
Int@brief`timeout_ms` field.
@detailsStores the default timeout in milliseconds. The field type is `Int`, and it is maintained by the constructors and methods of `SentinelConfig`.
var timeout_ms: Int;
/*
@brief `read_timeout_ms` field.varaio.redis::SentinelClient.cfg
Type
aio.redis.SentinelConfig@brief`cfg` field.
@detailsHolds the `cfg` value for each `SentinelClient` instance. The field type is `aio.redis.SentinelConfig`, and constructors and methods keep it synchronized with the object's runtime state.
var cfg: protocol.redis.Config;
/*
@brief `max_size` field.