Module node_config

Module node_config 

Source
Expand description

Runtime configuration for internal node buffers.

This module provides a global configuration mechanism for internal buffer settings used by codec and container nodes. These settings are typically set once at server startup and remain constant for the lifetime of the process.

§Usage

Server startup:

use streamkit_core::node_config::{set_node_buffer_config, NodeBufferConfig};

let config = NodeBufferConfig {
    codec_channel_capacity: 32,
    stream_channel_capacity: 8,
    demuxer_buffer_size: 65536,
    moq_peer_channel_capacity: 100,
};
set_node_buffer_config(config);

Node implementation:

use streamkit_core::node_config::get_codec_channel_capacity;

let (tx, rx) = mpsc::channel(get_codec_channel_capacity());

§Default Values

If set_node_buffer_config is never called, the getter functions return sensible defaults based on production experience:

  • codec_channel_capacity: 32 packets
  • stream_channel_capacity: 8 packets
  • demuxer_buffer_size: 65536 bytes (64KB)
  • moq_peer_channel_capacity: 100 packets (MoQ transport internal queues)

Structs§

NodeBufferConfig
Runtime configuration for node internal buffers.

Functions§

get_codec_channel_capacity
Returns the configured codec channel capacity.
get_demuxer_buffer_size
Returns the configured demuxer buffer size in bytes.
get_moq_peer_channel_capacity
Returns the configured MoQ peer channel capacity.
get_stream_channel_capacity
Returns the configured stream channel capacity.
set_node_buffer_config
Sets the global node buffer configuration.