return a func that will close the signal chan.
multiple invocations of the returned func will not generate a panic.
two funcs from separate invocations of Closer() (on the same sig chan) will cause a panic if both invoked.
for example:
// good
x := runtime.After(func() { ... })
f := x.Closer()
f()
f()
// bad
x := runtime.After(func() { ... })
f := x.Closer()
g := x.Closer()
f()
g() // this will panic
func Until(f func(), period time.Duration, stopCh <-chan struct{})
periodically execute the given function, stopping once stopCh is closed.
this func blocks until stopCh is closed, it's intended to be run as a goroutine.
return true if this latch was successfully acquired. concurrency safe. will only return true
upon the first invocation, all subsequent invocations will return false. always returns false
when self is nil.
spawn a goroutine to execute a func, immediately returns a chan that closes
upon completion of the func. returns a nil signal chan if the given func is nil.