Implement a feature that allows setting dynamic idle polling intervals in GoTick with support for multiple strategies, such as Zero, Constant interval, Exponential interval, and others as needed
π Problem Solved
Currently, GoTick has a fixed polling interval during idle states, which can lead to inefficiencies in resource usage. Introducing dynamic polling intervals can help optimize performance by adjusting the polling frequency based on current system load, job availability, or other factors, reducing unnecessary database queries or system checks
π‘ Proposed Solution
Strategy Pattern Implementation: Implement the Strategy pattern to allow easy addition and management of different polling interval strategies. Define an interface, PollingIntervalStrategy, which will have a method NextInterval() time.Duration to calculate the next polling interval and Reset() to reset current timer
Strategy Options: Zero Interval (Immediate re-polling without any delay. Useful when real-time processing is required), Constant Interval (A fixed interval that does not change, defined by the user), Exponential Interval (Starts with a base interval and increase it after each idle cycle, up to a maximum limit, to reduce the load on the system during low activity periods)
Configuration: Add configuration options to select the polling interval strategy and provide any necessary parameters (e.g., base interval, maximum interval for exponential strategy).
π Alternatives Considered
A simple backoff strategy without exponential growth, but it lacks the flexibility provided by multiple strategies
π¦ Additional Context
Ensure that the configuration is easily accessible via the existing configuration management system
π₯ Feature Description
Implement a feature that allows setting dynamic idle polling intervals in GoTick with support for multiple strategies, such as Zero, Constant interval, Exponential interval, and others as needed
π Problem Solved
Currently, GoTick has a fixed polling interval during idle states, which can lead to inefficiencies in resource usage. Introducing dynamic polling intervals can help optimize performance by adjusting the polling frequency based on current system load, job availability, or other factors, reducing unnecessary database queries or system checks
π‘ Proposed Solution
NextInterval() time.Duration
to calculate the next polling interval andReset()
to reset current timerπ Alternatives Considered
A simple backoff strategy without exponential growth, but it lacks the flexibility provided by multiple strategies
π¦ Additional Context
Ensure that the configuration is easily accessible via the existing configuration management system
π Related Issues
No response