Skip to content

Instantly share code, notes, and snippets.

@kasvith
Created November 9, 2019 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasvith/d8a9d9b6ade3d8ed22518066841359e0 to your computer and use it in GitHub Desktop.
Save kasvith/d8a9d9b6ade3d8ed22518066841359e0 to your computer and use it in GitHub Desktop.
// 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