@ Override public T get ( long timeout , TimeUnit unit ) throws TimeoutException { try { if ( ! latch . await ( timeout , unit ) ) { throw new TimeoutException ( "Command timed out" ) ; } } catch ( InterruptedException e ) { throw new RedisCommandInterruptedException ( e ) ; } return output . get ( ) ; }
Get the command output and if the command hasn t completed yet wait up to the specified time until it does .