4242
4343public class BinaryJedis implements BasicCommands , BinaryJedisCommands , MultiKeyBinaryCommands ,
4444 AdvancedBinaryJedisCommands , BinaryScriptingCommands , Closeable {
45+
4546 protected Client client = null ;
4647 protected Transaction transaction = null ;
4748 protected Pipeline pipeline = null ;
48- private final byte [][] dummyArray = new byte [0 ][];
49+ protected static final byte [][] DUMMY_ARRAY = new byte [0 ][];
4950
5051 public BinaryJedis () {
5152 client = new Client ();
@@ -4377,12 +4378,6 @@ public List<byte[]> xclaim(byte[] key, byte[] groupname, byte[] consumername,
43774378 return client .getBinaryMultiBulkReply ();
43784379 }
43794380
4380- public Object sendCommand (ProtocolCommand cmd , byte []... args ) {
4381- checkIsInMultiOrPipeline ();
4382- client .sendCommand (cmd , args );
4383- return client .getOne ();
4384- }
4385-
43864381 @ Override
43874382 public StreamInfo xinfoStream (byte [] key ) {
43884383 checkIsInMultiOrPipeline ();
@@ -4407,7 +4402,24 @@ public List<StreamConsumersInfo> xinfoConsumers (byte[] key, byte[] group) {
44074402 return BuilderFactory .STREAM_CONSUMERS_INFO_LIST .build (client .getBinaryMultiBulkReply ());
44084403 }
44094404
4405+ public Object sendCommand (ProtocolCommand cmd , byte []... args ) {
4406+ checkIsInMultiOrPipeline ();
4407+ client .sendCommand (cmd , args );
4408+ return client .getOne ();
4409+ }
4410+
4411+ public Object sendBlockingCommand (ProtocolCommand cmd , byte []... args ) {
4412+ checkIsInMultiOrPipeline ();
4413+ client .sendCommand (cmd , args );
4414+ client .setTimeoutInfinite ();
4415+ try {
4416+ return client .getOne ();
4417+ } finally {
4418+ client .rollbackTimeout ();
4419+ }
4420+ }
4421+
44104422 public Object sendCommand (ProtocolCommand cmd ) {
4411- return sendCommand (cmd , dummyArray );
4423+ return sendCommand (cmd , DUMMY_ARRAY );
44124424 }
44134425}
0 commit comments