forked from dork/tarantool-java
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply connection timeout for each connection attempt
Relax a socket provider contract. Now socket provider can throw a transient error and the client will try to obtain a socket again instead of being closed. Make built-in socket providers configurable. Now the client can set retries count and connection timeout for providers. Update README doc im scope of new socket provider contract. Closes: #167 Follows on: #144
- Loading branch information
1 parent
3420575
commit f960c18
Showing
12 changed files
with
277 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/org/tarantool/ConfigurableSocketChannelProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.tarantool; | ||
|
||
public interface ConfigurableSocketChannelProvider extends SocketChannelProvider { | ||
|
||
int RETRY_NO_LIMIT = 0; | ||
int NO_TIMEOUT = 0; | ||
|
||
/** | ||
* Configures max count of retries. | ||
* | ||
* @param limit max attempts count | ||
*/ | ||
void setRetriesLimit(int limit); | ||
|
||
/** | ||
* Configures max time to establish | ||
* a connection per attempt. | ||
* | ||
* @param timeout connection timeout in millis | ||
*/ | ||
void setConnectionTimeout(int timeout); | ||
|
||
} |
Oops, something went wrong.