cmdbox icon indicating copy to clipboard operation
cmdbox copied to clipboard

Add util.TimeOut() method

Open rwxrob opened this issue 3 years ago • 0 comments

Command line utilities typically never get the type of attention they need when it comes to timing out operations cleanly. For this reason, util.TimeOut() needs to be added. It should take a varying number of arguments but always requires the duration (in time.Sleep notation).

util.TimeOut(10 * time.Second)
util.TimeOut(10 * time.Second, "some message")
util.TimeOut(10 * time.Second, util.TimeOutFunc)

Keeping it with a variadic function signature will ensure that it remains compatible over time with the most high-level things.

rwxrob avatar Apr 25 '21 15:04 rwxrob