Class JdbiExecutorImpl

    • Field Detail

      • jdbi

        private final Jdbi jdbi
      • executor

        private final java.util.concurrent.Executor executor
    • Constructor Detail

      • JdbiExecutorImpl

        JdbiExecutorImpl​(Jdbi jdbi,
                         java.util.concurrent.Executor executor)
        Construct a JdbiExecutor.
        Parameters:
        jdbi - the initialized Jdbi class
        executor - an executor to use for all database calls
    • Method Detail

      • withExecute

        protected <T> java.util.concurrent.CompletionStage<T> withExecute​(CheckedFunction<Jdbi,​T> callback)
        Make sure to run the callback in a thread supplied by the executor
        Specified by:
        withExecute in class AbstractJdbiExecutor
        Type Parameters:
        T - type returned by the callback
        Parameters:
        callback - the callback that takes a Jdbi instance and returns a value
        Returns:
        a completion stage that will complete when the callback returns a value or throws an exception