Skip to content

Introduce cache cap, backoff when retrying previously failed events #285

Open
kkostov wants to merge 1 commit into
feat/processorsfrom
feat/improve-cache
Open

Introduce cache cap, backoff when retrying previously failed events #285
kkostov wants to merge 1 commit into
feat/processorsfrom
feat/improve-cache

Conversation

@kkostov
Copy link
Copy Markdown
Contributor

@kkostov kkostov commented May 11, 2026

This PR addresses a gap identified in #284 by capping the maximum number of events we keep in cache and introducing a back-off retry mechanism for previously failed events.

Users can configure both by overriding initialiser parameters on DefaultEventCache and DefaultEventTransmitter:

Parameter Type Default Description
DefaultEventCache(cacheLimit:) Int 10_000 Maximum events held in memory (FIFO)
DefaultEventTransmitter(transmitInterval:) TimeInterval 10 Seconds between transmission attempts
DefaultEventTransmitter(maxBackoffInterval:) TimeInterval 300 Upper bound for exponential backoff after consecutive failed batches
let cache = DefaultEventCache(cacheLimit: 5_000)
let transmitter = DefaultEventTransmitter(
    configuration: config,
    cache: cache,
    logger: DefaultLogger(),
    transmitInterval: 30,
    maxBackoffInterval: 600
)

Users can fully replace this implementation by providing their own EventCaching and EventTransmitting implementation

@kkostov kkostov force-pushed the feat/improve-cache branch from 650768e to 424d8a5 Compare May 11, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant