DurableStreams.Retention.Scheduler (Streamkeeper v0.3.0)
View SourcePeriodic scheduler for stream retention/compaction.
This GenServer runs at regular intervals and:
- Queries all streams with retention policies
- Identifies streams that need compaction
- Spawns compaction tasks (with concurrency limits)
- Tracks in-progress compactions to avoid duplicates
Configuration
:interval- How often to check for compaction needs (default: 30 seconds):max_concurrent- Maximum concurrent compaction tasks (default: 5)
Summary
Functions
Triggers an immediate compaction check. Useful for testing or manual intervention.
Returns a specification to start this module under a supervisor.
Returns the current scheduler state for debugging.
Functions
@spec check_now() :: :ok
Triggers an immediate compaction check. Useful for testing or manual intervention.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec status() :: map()
Returns the current scheduler state for debugging.