Merge pull request #1713 from bitglue/docs

Better document StateChangeConf.WaitForState
This commit is contained in:
Mitchell Hashimoto 2015-04-28 14:32:29 -07:00
commit 92a4a5ed23
1 changed files with 11 additions and 0 deletions

View File

@ -34,6 +34,17 @@ type StateChangeConf struct {
// WaitForState watches an object and waits for it to achieve the state
// specified in the configuration using the specified Refresh() func,
// waiting the number of seconds specified in the timeout configuration.
//
// If the Refresh function returns a error, exit immediately with that error.
//
// If the Refresh function returns a state other than the Target state or one
// listed in Pending, return immediately with an error.
//
// If the Timeout is exceeded before reaching the Target state, return an
// error.
//
// Otherwise, result the result of the first call to the Refresh function to
// reach the target state.
func (conf *StateChangeConf) WaitForState() (interface{}, error) {
log.Printf("[DEBUG] Waiting for state to become: %s", conf.Target)