Callback
A callback with no return value. Equivalent to () => Unit
.
- See also
CallbackTo
Type members
Classlikes
- Companion
- object
Value members
Concrete methods
Wraps a Future so that it is repeatable, and so that its inner callback is run when the future completes.
Wraps a Future so that it is repeatable, and so that its inner callback is run when the future completes.
The result is discarded. To retain it, use CallbackTo.future instead.
Because the Future
is discarded, when an exception causes it to fail, the exception is re-thrown.
If you want the exception to be ignored or handled differently, use CallbackTo.future instead and then
.void
to discard the future and turn the result into a Callback
.
WARNING: Futures are scheduled to run as soon as they're created. Ensure that the argument you provide creates a new Future; don't reference an existing one.
Callback that isn't created until the first time it is used, after which it is reused.
Callback that isn't created until the first time it is used, after which it is reused.
Run all given callbacks.
Run all given callbacks.
All results are discarded.
Any exceptions get a printStackTrace
and are then discarded, and the next callback run.
- Since
2.0.0
Convenience for applying a condition to a callback, and returning Callback.empty
when the condition is already
satisfied.
Convenience for applying a condition to a callback, and returning Callback.empty
when the condition is already
satisfied.
Notice the condition is strict. If non-strictness is desired use callback.unless(cond)
.
- Value Params
- cond
The condition required to be
false
for the callback to execute.
Convenience for applying a condition to a callback, and returning Callback.empty
when the condition isn't
satisfied.
Convenience for applying a condition to a callback, and returning Callback.empty
when the condition isn't
satisfied.
Notice the condition is strict. If non-strictness is desired use callback.when(cond)
.
- Value Params
- cond
The condition required to be
true
for the callback to execute.
Deprecated methods
Serves as a temporary placeholder for a callback until you supply a real implementation.
Serves as a temporary placeholder for a callback until you supply a real implementation.
Unlike ???
this doesn't crash, it just prints a warning to the console.
Also it's not really deprecated; that's just so you get a compiler warning as a reminder.
- Deprecated
Serves as a temporary placeholder for a callback until you supply a real implementation.
Serves as a temporary placeholder for a callback until you supply a real implementation.
Unlike ???
this doesn't crash, it just prints a warning to the console.
Also it's not really deprecated; that's just so you get a compiler warning as a reminder.
- Deprecated
Callback that is recreated each time it is used.
Callback that is recreated each time it is used.
https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_name
- Deprecated