alligator.workers

class alligator.workers.Worker(gator, max_tasks=0, to_consume='all', nap_time=0.1)
ident()

Returns a string identifier for the worker.

Used in the printed messages & includes the process ID.

result(result)

Prints the received result from a task to stdout.

Parameters:result – The result of the task
run_forever()

Causes the worker to run either forever or until the Worker.max_tasks are reached.

starting()

Prints a startup message to stdout.

stopping()

Prints a shutdown message to stdout.