Created
November 9, 2019 08:27
-
-
Save kasvith/d8a9d9b6ade3d8ed22518066841359e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SetAlive for this backend | |
func (b *Backend) SetAlive(alive bool) { | |
b.mux.Lock() | |
b.Alive = alive | |
b.mux.Unlock() | |
} | |
// IsAlive returns true when backend is alive | |
func (b *Backend) IsAlive() (alive bool) { | |
b.mux.RLock() | |
alive = b.Alive | |
b.mux.RUnlock() | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment