Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shenek/wait-for-them
Wait until TCP services are running.
https://github.com/shenek/wait-for-them
cli docker-compose rust
Last synced: 10 days ago
JSON representation
Wait until TCP services are running.
- Host: GitHub
- URL: https://github.com/shenek/wait-for-them
- Owner: shenek
- Created: 2020-03-12T23:22:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-20T19:20:40.000Z (7 months ago)
- Last Synced: 2024-05-21T00:55:05.789Z (6 months ago)
- Topics: cli, docker-compose, rust
- Language: Rust
- Size: 219 KB
- Stars: 15
- Watchers: 4
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
Awesome Lists containing this project
README
![Security audit](https://github.com/shenek/wait-for-them/workflows/Security%20audit/badge.svg)
![Code Quality](https://github.com/shenek/wait-for-them/workflows/Code%20Quality/badge.svg)
![Release](https://github.com/shenek/wait-for-them/workflows/Release/badge.svg)
[![Documentation](https://docs.rs/wait-for-them/badge.svg)](https://docs.rs/wait-for-them/)
![Downloads](https://img.shields.io/crates/d/wait-for-them.svg)# Wait-For-Them
Waits until all provided host and port pairs are opened or return status 200 in case of http(s) url.
It is written using async rust.![Cast](/wait-for-them.gif)
## Installation
There are currently two way how to install the app.
You can install the binary only with a minimal subset of features.
```bash
cargo install wait-for-them --no-default-features
```Or you can install it with all its features (including the nice progressbars and http(s) support).
```bash
cargo install wait-for-them
```## Running
### Wait forever
```bash
wait-for-them host1:port1 host2:port2 http://host3:8080/
```### Wait with timeout (in milliseconds)
```
wait-for-them -t 5000 host1:port1 host2:port2 http://host3:8080/
```Note that it returns a number of unopened host:port combinations.
So if it worked ok it returns standard `0`.### Execute a command after all hosts have opened ports
```
wait-for-them host1:port1 host2:port2 http://host3:8080/ -- cmd arg1 arg2
```Note that if the ports are opened it returns the status code of cmd.
## Motivation
The main motivation of this program was to use it within `docker-compose` config file (see `docker-compose.yml`).
To support waiting for multiple hostname:port records in parallel.