golang-awaitility

module
v0.0.0-...-fb55e59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2018 License: MIT

README

golang-awaitility

Golang Awaitility Logo

Package golang_awaitility provides a simple mechanism to poll for conditions with a general timeout.

It is inspired by the great jvm lib "awaitility" (see https://github.com/awaitility/awaitility)

Example

package example

import (
	"github.com/ecodia/golang-awaitility/awaitility"
	"testing"
	"time"
	)

func TestSomething(t *testing.T)  {
   	err := awaitility.Await(100 * time.Millisecond, 1000 * time.Millisecond, func() bool {
   		// do a real check here, e.g. some kind of isConnected()
   		return true
   	})
   	
   	if err != nil {
   		t.Errorf("Unexpected error during await: %s", err)
   	}
 
}

Directories

Path Synopsis
Package awaitility provides a simple mechanism to poll for conditions with a general timeout.
Package awaitility provides a simple mechanism to poll for conditions with a general timeout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL