Make all hardcoded timing/buffer constants configurable with good defaults #129
Labels
No labels
bug
documentation
enhancement
investigation
nice-to-have
performance
production-ready
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ash/eskit#129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Several components have hardcoded timing and buffer constants that should be configurable:
ChangeNotifier (
changenotifier.go)changeNotifierBufferSize = 64— subscriber channel bufferPGChangeRelay (
pgstore/change_relay.go)changeReconnectDelay = 1s— reconnection delay after connection loss2s— PG NOTIFY timeoutChannelEventBus (
eventbus_channel.go)channelBufSize = 256— subscriber channel bufferSolution
ChangeNotifier
Add options pattern:
The fallback poll is critical: if a notification is dropped (buffer full), the SSE handler currently has NO way to recover. Add an optional ticker that fires a synthetic change so SSE handlers re-read from DB. Default: 5s. Set to 0 to disable.
Alternatively, add a
SubscribeWithPoll(projection, interval)that returns a channel that also receives periodic ticks — letting each subscriber choose their own fallback interval.PGChangeRelay
Add to constructor or options:
Defaults: reconnect 1s, broadcast 2s.
ChannelEventBus
Add option:
Default: 256.
Requirements
Related: subscription.Config already does this correctly — PollInterval, RetryBaseDelay, etc. are all configurable with defaults. Match that pattern.