File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/main/java/com/redislabs/redisgraph Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 66import redis .clients .jedis .Jedis ;
77import redis .clients .jedis .JedisPool ;
88import redis .clients .jedis .commands .ProtocolCommand ;
9+ import redis .clients .jedis .util .Pool ;
910
1011/**
1112 * RedisGraph client
1213 */
1314public class RedisGraphAPI {
1415
15- final private JedisPool client ;
16+ final private Pool < Jedis > client ;
1617 final private String graphId ;
1718
1819 /**
@@ -32,8 +33,18 @@ public RedisGraphAPI(String graphId) {
3233 * @param port Redis port
3334 */
3435 public RedisGraphAPI (String graphId , String host , int port ) {
36+ this (graphId , new JedisPool (host , port ));
37+ }
38+
39+ /**
40+ * Creates a client to a specific graph using provided Jedis pool
41+ *
42+ * @param graphId the graph id
43+ * @param jedis bring your own Jedis pool
44+ */
45+ public RedisGraphAPI (String graphId , Pool <Jedis > jedis ) {
3546 this .graphId = graphId ;
36- this .client = new JedisPool ( host , port ) ;
47+ this .client = jedis ;
3748 }
3849
3950 /**
You can’t perform that action at this time.
0 commit comments