Skip to content

Conversation

athos
Copy link
Owner

@athos athos commented Sep 5, 2021

Resolves #2.

This PR adds the --retry-timeout DURATION and --retry-interval DURATION options to control connection retry.
For example, the following command will retry the connection every 5 seconds for up to 30 seconds:

$ trench --retry-timeout 30s --retry-interval 5s

This change breaks the library-level compatibility for the nrepl and prepl clients.
Before the change, to create an nREPL client, you needed to do something like the following:

client := nrepl.NewClient(&Opts{Host: "localhost", Port: 12345, ...})

After the change, you need to do something like this:

client := nrepl.NewClient(&Opts{ConnBuilder: &client.TCPConnBuilder{Host: "localhost", Port: 12345}, ...})

The same goes for the prepl client.

@athos athos force-pushed the feature/retry-connection branch from 148c532 to fb11db0 Compare September 6, 2021 14:01
@athos athos merged commit 52da7bc into main Sep 6, 2021
@athos athos deleted the feature/retry-connection branch September 6, 2021 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow client to retry connection to wait for server to start up
1 participant