Skip to content

Commit 4e0637e

Browse files
authored
RedisAI constructor with poolSize along with clientConfig (#60)
1 parent f3fc003 commit 4e0637e

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

src/main/java/com/redislabs/redisai/RedisAI.java

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public RedisAI(String host, int port) {
4343
*
4444
* @param host the redis host
4545
* @param port the redis pot
46+
* @param timeout
47+
* @param poolSize
4648
*/
4749
public RedisAI(String host, int port, int timeout, int poolSize) {
4850
this(host, port, timeout, poolSize, null);
@@ -53,6 +55,8 @@ public RedisAI(String host, int port, int timeout, int poolSize) {
5355
*
5456
* @param host the redis host
5557
* @param port the redis pot
58+
* @param timeout
59+
* @param poolSize
5660
* @param password the password for authentication in a password protected Redis server
5761
*/
5862
public RedisAI(String host, int port, int timeout, int poolSize, String password) {
@@ -66,7 +70,32 @@ public RedisAI(String host, int port, int timeout, int poolSize, String password
6670
* @param clientConfig
6771
*/
6872
public RedisAI(HostAndPort hostAndPort, JedisClientConfig clientConfig) {
69-
this(new JedisPool(new GenericObjectPoolConfig<>(), hostAndPort, clientConfig));
73+
this(new GenericObjectPoolConfig<>(), hostAndPort, clientConfig);
74+
}
75+
76+
/**
77+
* Create a new RedisAI client
78+
*
79+
* @param hostAndPort
80+
* @param clientConfig
81+
* @param poolSize
82+
*/
83+
public RedisAI(HostAndPort hostAndPort, JedisClientConfig clientConfig, int poolSize) {
84+
this(initPoolConfig(poolSize), hostAndPort, clientConfig);
85+
}
86+
87+
/**
88+
* Create a new RedisAI client
89+
*
90+
* @param poolConfig
91+
* @param hostAndPort
92+
* @param clientConfig
93+
*/
94+
public RedisAI(
95+
GenericObjectPoolConfig<Jedis> poolConfig,
96+
HostAndPort hostAndPort,
97+
JedisClientConfig clientConfig) {
98+
this(new JedisPool(poolConfig, hostAndPort, clientConfig));
7099
}
71100

72101
/**

0 commit comments

Comments
 (0)