Class SyncCallbackUtils


  • class SyncCallbackUtils
    extends java.lang.Object
    Utility for callbacks.
    • Constructor Detail

      • SyncCallbackUtils

        SyncCallbackUtils()
    • Method Detail

      • waitForResult

        public static <T> T waitForResult​(java.util.concurrent.CompletableFuture<T> future)
                                   throws java.lang.InterruptedException,
                                          BKException
        Wait for a result. This is convenience method to implement callbacks
        Type Parameters:
        T -
        Parameters:
        future -
        Returns:
        Throws:
        java.lang.InterruptedException
        BKException
      • finish

        public static <T> void finish​(int rc,
                                      T result,
                                      java.util.concurrent.CompletableFuture<? super T> future)
        Handle the Response Code and transform it to a BKException.
        Type Parameters:
        T -
        Parameters:
        rc -
        result -
        future -