0.0
No commit activity in last 3 years
No release in over 3 years
A script that waits for a TCP socket to be available at a given address
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.0
 Project Readme

wait-for-socket

A simple script that waits for a TCP socket to be accepting connections.

How

Add this to your Gemfile like any other gem:

gem 'wait-for-socket'

.. and then wait for a TCP socket, like MySQL:

bundle exec wait-for-socket --description MySQL --address 127.0.0.1 --port 3306
Waiting for MySQL to become available at 127.0.0.1:3306
....
MySQL ready

.. or postgres:

bundle exec wait-for-socket --description PostgreSQL --address 127.0.0.1 --port 5432
Waiting for PostgreSQL to become available at 127.0.0.1:5432
....
PostgreSQL ready

Why

This is a pretty poor excuse for a rubygem - all it has is a single executable script.

It's bundled into a gem for ease of distriubtion. I've needed this functionality in many ruby applications (particularly in test suites running in docker), and this was the easiest way to share the script.