Module rabotnik.rabotnikinstance

Functions

def command_line_interface()

Command-line interface of Rabotnik. The program starts a Celery app with concurrent workers carrying out Rabotnik tasks. The first command-line option is the definition of the Rabotnik type. Both are needed in parallel for a functioning Rabotnik instance and both need to have the same name to be able to communicate with each other. worker: Initializes a Celery worker that distributes the Rabotnik tasks over many processes. listener: Listens to a broker queue and sends the result to the Celery worker.

Options

-n: Name of the Rabotnik instance. This needs to be unique, as it will determine the queue and processor names too. -v: Increases output verbosity (e.g., -vv is more than -v). The INFO logs are -vv. -M: Maximum number of Celery workers that are active. -m: Minimum number of Celery workers that are active.

def rabotnik_listener(name, verbosity)

Listens to a broker queue and sends the result to the Celery worker.

Args

name (str): Name of the Rabotnik instance. verbosity (int): Level of verbosity: ERROR=0; WARNING=1; INFO=2; DEBUG=3;

def rabotnik_worker(name, verbosity, min_concurrency, max_concurrency)

Initialize a Celery worker that distributes the Rabotnik tasks over many processes.

Args

name (str): Name of the Rabotnik instance. verbosity (int): Level of verbosity: ERROR=0; WARNING=1; INFO=2; DEBUG=3; min_concurrency (int): Minimum number of Celery workers that are active. max_concurrency (int): Maximum number of Celery workers that are active.