Skip to content

singlestore-labs/wait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wait - wait for a condition to become true

GoDoc unit tests report card codecov

Install:

go get github.com/singlestore-labs/wait

Wait provides one function: For.

	err := wait.For(func() (bool, error) {
		err := trySomething()
		if err != nil {
			if isFatal(err) {
				return false, err
			}
			return false, nil
		}
		return true, nil
	})

It calls its function argument over and over until:

  • a timeout occurs (failure)
  • the bool becomes true (success or failure depending on error)
  • if ExitOnError(true) and the error becomes non nil (failure)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •