Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client wait for connection #8

Closed
jeffque opened this issue Nov 7, 2024 · 9 comments
Closed

Client wait for connection #8

jeffque opened this issue Nov 7, 2024 · 9 comments
Labels
good first issue Good for newcomers

Comments

@jeffque
Copy link
Owner

jeffque commented Nov 7, 2024

The default behavior is (and should continue to be) for the client to fail immediately when there is no server in the port.

It would be good that, given a CLI flag, it would wait until a server is available in such port. It should retry at a regular interval to connect.

@jeffque jeffque added the good first issue Good for newcomers label Nov 7, 2024
@reinaldorauch
Copy link
Contributor

reinaldorauch commented Nov 7, 2024

Hello! Something like teecp --wait ? Or --wait-connection?

@jeffque
Copy link
Owner Author

jeffque commented Nov 7, 2024

Hello! Something like teecp --wait ?

--wait-connection seems great! Better than my previous idea

@jeffque
Copy link
Owner Author

jeffque commented Nov 7, 2024

@reinaldorauch , do you think it will be intuitive to have something like --wait-connection=250 ? Meaning that it will wait for 250ms before trying again?

I am not sure if this will be a great CLI experience

@reinaldorauch
Copy link
Contributor

reinaldorauch commented Nov 7, 2024

I was about to ask if would make sense defining the timeout. I totally would use that! Also it raises the need for a interval switch I guess, like --retry-interval

Also, I think it wouldn't be difficult to parse the time unit there so the use could set --wait-connection=1s or --wait-connection=250ms like you said

@jeffque
Copy link
Owner Author

jeffque commented Nov 7, 2024

Agreed.

@reinaldorauch
Copy link
Contributor

Nice! Just to summarize the design and the requirements:

  • new option --wait-connection that makes the client wait for the connection on the port with a regular interval
  • with no value specified, it waits for a default (?) time
  • the user can specify a value which may or not have the time unit, which will defaults to ? (Milliseconds? Seconds?)
  • the User can fully specify the value with the value and the time unit. Will check the go libs that is most common to handle these so we can leverage the pattern
  • it can be used with a future new option --retry-interval that will set that value

@reinaldorauch
Copy link
Contributor

Hey, opened a PR with the implementation!

@jeffque
Copy link
Owner Author

jeffque commented Nov 7, 2024

Solved by #9

@jeffque jeffque closed this as completed Nov 7, 2024
@jeffque
Copy link
Owner Author

jeffque commented Nov 7, 2024

Thanks @reinaldorauch ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants