You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
358 B
19 lines
358 B
package steps;
|
|
|
|
import "time"
|
|
import "log"
|
|
|
|
type WaitStep struct {
|
|
duration time.Duration
|
|
}
|
|
|
|
func NewWaitStep(duration time.Duration) *WaitStep {
|
|
return &WaitStep{ duration: duration };
|
|
}
|
|
|
|
func (ws *WaitStep) Do(log *log.Logger) error {
|
|
log.Printf("Sleeping during %v", ws.duration)
|
|
time.Sleep(ws.duration)
|
|
log.Println("Woken up !")
|
|
return nil
|
|
}
|
|
|