Class 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 Detail

      • clone

        public Future clone()
        Creates a copy of the Future
        Overrides:
        clone in class Object
      • 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.