private < Input , Output > ListenableFuture < Output > monitorFuture ( Timer timer , ListenableFuture < Input > listenableFuture , Function < Input , Output > userCallback ) { Futures . addCallback ( listenableFuture , new FutureTimerCallback <> ( timer ) ) ; return Futures . transform ( listenableFuture , new JdkFunctionWrapper <> ( userCallback ) ) ; }
Monitor future completion