balancer.core.common package

Submodules

balancer.core.common.algorithms module

balancer.core.common.target module

balancer.core.common.worker module

class balancer.core.common.worker.Worker(host: str, port: int, client_socket: socket, client_host: str, buffer_size: int = 8192)[source]

Bases: Process

A class which handles the worker-side of processing a request (communicating between the back-end worker and the requesting client)

close_connections()[source]

It closes the client and worker sockets, and then sets the default signal handler for SIGTERM

close_connections_and_shutdown(*args)[source]

It closes all connections and shuts down the program

run()[source]

It reads data from the client socket and sends it to the worker socket, and vice versa :return: The data that is being returned is the data that is being sent to the client.

Module contents