Wait4X is a lightweight, zero-dependency tool designed to ensure services are ready before proceeding. Ideal for CI/CD pipelines, deployment processes, and application initialization, it supports various protocols to seamlessly check the availability of dependencies, improving the efficiency and reliability of your workflows.
Wait4X is a versatile and lightweight tool designed to confidently manage service readiness checks across various environments. It effectively waits for ports or services to reach the desired state, making it indispensable in scenarios such as:
| Feature | Description |
|---|---|
| Multi-Protocol Support | Compatible with TCP, HTTP, DNS protocols. |
| Service Integrations | Works with popular databases like Redis, MySQL, PostgreSQL, MongoDB, as well as message queues like RabbitMQ and Temporal. |
| Reverse Checking | Allows checks to identify free ports and non-ready services. |
| Parallel Checking | Facilitates simultaneous checks for multiple services. |
| Exponential Backoff | Implements retry logic with increasing delays to enhance stability. |
| CI/CD Integration | Tailored for seamless automation workflows. |
| Cross-Platform Compatibility | Provides a single binary useable on Linux, macOS, and Windows. |
| Go Package Accessibility | Easily importable into Go applications. |
| Command Execution | Enables execution of commands once checks succeed. |
Basic TCP Check\ Wait for a specific port to become available:
wait4x tcp localhost:3306
HTTP Health Check\ Check for a web server's specific response:
wait4x http https://example.com/health --expect-status-code 200 --expect-body-regex '"status":"UP"'
Multi-Service Check (Parallel)\ Wait for multiple services simultaneously:
wait4x tcp 127.0.0.1:5432 127.0.0.1:6379 127.0.0.1:27017
Database Readiness Check\ Validate PostgreSQL readiness:
wait4x postgresql 'postgres://user:pass@localhost:5432/mydb?sslmode=disable'
Execute Command After Success\ Run a command after confirming services are ready:
wait4x tcp localhost:8080 -- echo "Service is ready!" && ./start-app.sh
Wait4X supports advanced features such as setting timeouts, customizing headers, and parallel checks. For detailed examples on various use cases, including custom checkers and advanced options for HTTP and DNS checking, consult the extensive examples/pkg directory. Each example features a runnable main.go file for practical demonstration.
Contributions to the project are welcomed through open issues and pull requests, ensuring that Wait4X remains an effective and user-friendly tool for managing service readiness across a range of applications.
No comments yet.
Sign in to be the first to comment.