Package org.ldk.structs
Class Future
- java.lang.Object
-
- org.ldk.structs.Future
-
public class Future extends Object
A simple future which can complete once, and calls some callback(s) when it does so. Clones can be made and all futures cloned from the same source will complete at the same time.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Future
clone()
Creates a copy of the Futureprotected void
finalize()
void
register_callback_fn(FutureCallback callback)
Registers a callback to be called upon completion of this future.void
wait_indefinite()
Waits until this [`Future`] completes.boolean
wait_timeout(long max_wait)
Waits until this [`Future`] completes or the given amount of time has elapsed.
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
register_callback_fn
public void register_callback_fn(FutureCallback callback)
Registers a callback to be called upon completion of this future. If the future has already completed, the callback will be called immediately.
-
wait_indefinite
public void wait_indefinite()
Waits until this [`Future`] completes.
-
wait_timeout
public boolean wait_timeout(long max_wait)
Waits until this [`Future`] completes or the given amount of time has elapsed. Returns true if the [`Future`] completed, false if the time elapsed.
-
-