mirror of
https://github.com/redis/go-redis.git
synced 2025-09-10 07:11:50 +03:00
* feat(hitless): Introduce handlers for hitless upgrades This commit includes all the work on hitless upgrades with the addition of: - Pubsub Pool - Examples - Refactor of push - Refactor of pool (using atomics for most things) - Introducing of hooks in pool --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
25 lines
470 B
Go
25 lines
470 B
Go
package hitless
|
|
|
|
// State represents the current state of a hitless upgrade operation.
|
|
type State int
|
|
|
|
const (
|
|
// StateIdle indicates no upgrade is in progress
|
|
StateIdle State = iota
|
|
|
|
// StateHandoff indicates a connection handoff is in progress
|
|
StateMoving
|
|
)
|
|
|
|
// String returns a string representation of the state.
|
|
func (s State) String() string {
|
|
switch s {
|
|
case StateIdle:
|
|
return "idle"
|
|
case StateMoving:
|
|
return "moving"
|
|
default:
|
|
return "unknown"
|
|
}
|
|
}
|