Skip to content

EntropyEngine::Networking::SchemaNackTracker

EntropyEngine::Networking::SchemaNackTracker

Section titled “EntropyEngine::Networking::SchemaNackTracker”

Tracks schema NACKs with rate limiting and metrics. More…

#include <SchemaNackTracker.h>

Name
structConfig
Configuration for NACK rate limiting.
Name
boolshouldSendNack(const ComponentTypeHash & typeHash)
Check if a NACK should be sent for a schema.
voidrecordNackSent(const ComponentTypeHash & typeHash)
Record that a NACK was sent.
size_tgetUniqueSchemas() const
Get number of unique schemas NACKed.
size_tgetTotalNacksSent() const
Get total number of NACKs sent.
voidclear()
Clear all tracked state.
SchemaNackTracker(const Config & config =Config())
class EntropyEngine::Networking::SchemaNackTracker;

Tracks schema NACKs with rate limiting and metrics.

Simple tracker to prevent NACK spam when encountering unknown schemas. Uses basic time-based rate limiting per schema hash.

bool shouldSendNack(
const ComponentTypeHash & typeHash
)

Check if a NACK should be sent for a schema.

Parameters:

  • typeHash The ComponentTypeHash that is unknown

Return: true if NACK should be sent, false if rate limited

Applies rate limiting - returns true if enough time has passed since last NACK.

void recordNackSent(
const ComponentTypeHash & typeHash
)

Record that a NACK was sent.

Parameters:

  • typeHash The ComponentTypeHash that was NACKed

Updates the last NACK timestamp for the schema.

size_t getUniqueSchemas() const

Get number of unique schemas NACKed.

size_t getTotalNacksSent() const

Get total number of NACKs sent.

void clear()

Clear all tracked state.

explicit SchemaNackTracker(
const Config & config =Config()
)

Updated on 2026-01-26 at 16:50:32 -0500