SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
presage::smartspectra::redis_ipc::RedisIpcConfig Struct Reference

#include <redis_ipc_configuration.hpp>

Classes

struct  Channels
struct  Keys

Public Member Functions

nlohmann::json ToJson () const

Static Public Member Functions

static absl::StatusOr< RedisIpcConfigLoadFromJson (const std::filesystem::path &path)
static absl::Status SaveToJson (const RedisIpcConfig &config, const std::filesystem::path &path)
static absl::StatusOr< RedisIpcConfigFromJson (const nlohmann::json &j)

Public Attributes

std::string host = "localhost"
int port = 6379
std::optional< std::string > password
int database = 0
std::string key_prefix = "physiology"
std::chrono::milliseconds connection_timeout {1500}
std::chrono::milliseconds operation_timeout {1000}
std::chrono::milliseconds reconnect_interval {5000}
size_t max_reconnect_attempts = 10
struct presage::smartspectra::redis_ipc::RedisIpcConfig::Channels channels
struct presage::smartspectra::redis_ipc::RedisIpcConfig::Keys keys
size_t max_list_size = 10000
std::chrono::seconds frame_ttl {300}
bool enable_pipelining = true
bool enable_debug_logging = false
bool use_streams = false
size_t stream_max_entries = 100000
size_t max_bulk_string_bytes = 134217728
size_t max_array_elements = 1000000

Detailed Description

Configuration for Redis-based IPC communication.

This configuration defines how the physiology system should use Redis pub/sub and data structures to communicate between Edge and Core components.

Member Function Documentation

◆ FromJson()

absl::StatusOr< RedisIpcConfig > presage::smartspectra::redis_ipc::RedisIpcConfig::FromJson ( const nlohmann::json & j)
static

Create a configuration from a JSON object.

Parameters
jThe JSON object to deserialize
Returns
RedisIpcConfig created from the JSON or error status

◆ LoadFromJson()

absl::StatusOr< RedisIpcConfig > presage::smartspectra::redis_ipc::RedisIpcConfig::LoadFromJson ( const std::filesystem::path & path)
static

Load configuration from a JSON file.

Parameters
pathPath to the JSON configuration file
Returns
Loaded configuration (with defaults for missing fields) or error status

◆ SaveToJson()

absl::Status presage::smartspectra::redis_ipc::RedisIpcConfig::SaveToJson ( const RedisIpcConfig & config,
const std::filesystem::path & path )
static

Save configuration to a JSON file.

Parameters
configThe configuration to save
pathPath where the JSON file should be written
Returns
OK status or error status

◆ ToJson()

nlohmann::json presage::smartspectra::redis_ipc::RedisIpcConfig::ToJson ( ) const
nodiscard

Convert this configuration to a JSON object.

Returns
nlohmann::json representation of this configuration

Member Data Documentation

◆ connection_timeout

std::chrono::milliseconds presage::smartspectra::redis_ipc::RedisIpcConfig::connection_timeout {1500}

Connection timeout for Redis operations. Default: 1500ms

◆ database

int presage::smartspectra::redis_ipc::RedisIpcConfig::database = 0

Redis database number to use. Default: 0

◆ enable_debug_logging

bool presage::smartspectra::redis_ipc::RedisIpcConfig::enable_debug_logging = false

Whether to enable debug logging for Redis operations. Default: false

◆ enable_pipelining

bool presage::smartspectra::redis_ipc::RedisIpcConfig::enable_pipelining = true

Whether to enable Redis command pipelining for better performance. Default: true

◆ frame_ttl

std::chrono::seconds presage::smartspectra::redis_ipc::RedisIpcConfig::frame_ttl {300}

TTL (time-to-live) for frame data in Redis. Frames older than this will be automatically expired. Default: 300 seconds (5 minutes), 0 = no expiration

◆ host

std::string presage::smartspectra::redis_ipc::RedisIpcConfig::host = "localhost"

Redis server hostname or IP address. Default: "localhost"

◆ key_prefix

std::string presage::smartspectra::redis_ipc::RedisIpcConfig::key_prefix = "physiology"

Key prefix for all Redis keys and channels. This allows multiple instances to share the same Redis server. Example: "physiology:instance1" would create keys like:

  • "physiology:instance1:core_metrics"
  • "physiology:instance1:edge_metrics"
  • "physiology:instance1:status"

◆ max_array_elements

size_t presage::smartspectra::redis_ipc::RedisIpcConfig::max_array_elements = 1000000

Maximum RESP array element count accepted from Redis replies. Default: 1000000 (1M elements). Set to 0 for no limit.

◆ max_bulk_string_bytes

size_t presage::smartspectra::redis_ipc::RedisIpcConfig::max_bulk_string_bytes = 134217728

Maximum RESP bulk string payload size accepted from Redis (bytes). Default: 134217728 (128MB). Set to 0 for no limit.

◆ max_list_size

size_t presage::smartspectra::redis_ipc::RedisIpcConfig::max_list_size = 10000

Maximum size for Redis lists (for buffering). Older entries will be removed when limit is exceeded. Default: 10000 entries (0 = unlimited)

◆ max_reconnect_attempts

size_t presage::smartspectra::redis_ipc::RedisIpcConfig::max_reconnect_attempts = 10

Maximum number of reconnection attempts before giving up. Default: 10 (0 = unlimited)

◆ operation_timeout

std::chrono::milliseconds presage::smartspectra::redis_ipc::RedisIpcConfig::operation_timeout {1000}

Read/write timeout for individual Redis operations. Default: 1000ms

◆ password

std::optional<std::string> presage::smartspectra::redis_ipc::RedisIpcConfig::password

Optional Redis password for authentication. If empty, no authentication will be attempted.

◆ port

int presage::smartspectra::redis_ipc::RedisIpcConfig::port = 6379

Redis server port number. Default: 6379 (standard Redis port)

◆ reconnect_interval

std::chrono::milliseconds presage::smartspectra::redis_ipc::RedisIpcConfig::reconnect_interval {5000}

Reconnection interval when connection is lost. Default: 5000ms

◆ stream_max_entries

size_t presage::smartspectra::redis_ipc::RedisIpcConfig::stream_max_entries = 100000

Maximum entries in Redis Streams (if use_streams is true). Default: 100000 entries

◆ use_streams

bool presage::smartspectra::redis_ipc::RedisIpcConfig::use_streams = false

Whether to use Redis Streams instead of pub/sub for metrics. Streams provide persistence and guaranteed delivery. Default: false (use pub/sub)


The documentation for this struct was generated from the following files: