blackhole.supervisor

Provides functionality to create the supervisor process.

class blackhole.supervisor.Supervisor(*args, **kwargs)[source]

The supervisor process.

Responsible for monitoring and controlling child processes via an internal map of workers and the children they manage.

generate_servers()[source]

Spawn all of the required sockets and TLS contexts.

create_socket(listeners, use_tls=False)[source]

Create supervisor socket.

run()[source]

Start all workers and their children.

Attaches signals and runs the event loop.

start_workers()[source]

Start each worker and it’s child process.

stop_workers()[source]

Stop the workers and their respective child process.

close_socks()[source]

Close all opened sockets.

stop(*args, **kwargs)[source]

Terminate all of the workers.

Generally should be called by a signal, nothing else.

Raises

SystemExit – With code os.EX_OK.