1
0
mirror of https://github.com/redis/go-redis.git synced 2025-09-10 07:11:50 +03:00
Files
go-redis/hitless/state.go
Nedyalko Dyakov cb3af0800e [CAE-1072] Hitless Upgrades (#3447)
* 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>
2025-09-03 14:49:16 +03:00

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"
}
}