Skip to content

tomplex/socket_wait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socket Wait

Basic utility to block until a connection is a recieved on a socket.

Usage

Works with python 2.7+.

Install with pip:

pip install socket-wait

This adds a new CLI tool:

socket_wait 9009

This will bind to port 9009 and block until a connection is received, like so:

nc -z localhost 9009

Why?

Inter-process communication. TCP allows a quick and dependency-free way for one process to alert another that it is ready, or has completed, or any number of things. I use it in docker-compose apps which require some sort of loading to occur before the service is ready (like loading some data to a database which the process will use). This allows the service performing the loading to call back to the waiting process (waiting using this tool) to let it know that it can proceed.

About

Utility to wait until a TCP connection is established.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages