Package io.javago.sync
Class OnceFunc
java.lang.Object
io.javago.sync.OnceFunc
- All Implemented Interfaces:
Runnable
The
OnceFunc
class implements Go's sync.OnceFunc
.
A Runnable
wrapper that ensures the wrapped Runnable
is executed only once.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
OnceFunc
Constructs a newOnceFunc
that will wrap the givenRunnable
.- Parameters:
func
- theRunnable
to be wrapped and executed only once
-
-
Method Details