androlyze.celery package

Submodules

androlyze.celery.CeleryConstants module

androlyze.celery.CeleryConstants.get_analyze_task_name()[source]

androlyze.celery.CeleryUtil module

androlyze.celery.CeleryUtil.exp_backoff(task, _max=64)[source]

Use exponential backoff for task retrying.

wait_time = 2^1,..., 2^n limit by _max.

Parameters:

task : celery.app.task.Task

_max : int, optional (default is 64)

Maximum time to use.

androlyze.celery.CeleryUtil.get_completed_tasks(group_result, total_cnt, tasks_per_chunk=1)[source]

Get number of completed tasks from group_result.

Parameters:

group_result : GroupResult

total_cnt : int

Number of total tasks.

tasks_per_chunk : int, optional (default is 1)

Number of chunks the work is divided into.

androlyze.celery.CeleryUtil.get_registered_workers()[source]

Get the registered celery workers

androlyze.celery.CeleryUtil.get_successful_analyze_task_results(group_result, chunked=False)[source]

Get results for successful tasks from group_result (meaning their results) and ignore revoked ones.

Parameters:

group_result : GroupResult

chunked : bool, optional (default is False)

If work has been divided into chunks.

Returns:

list< tuple<id, gridfs (bool)>>

androlyze.celery.CeleryUtil.get_workers_and_check_network()[source]

Get the celery workers and check network.

Returns:

str

List of workers as str.

Raises:

NetworkError

androlyze.celery.CeleryUtil.join_native(result_group, timeout=None, propagate=True, interval=0.5, callback=None)[source]

Same as :py:method:`GroupResult.join_native` but delivers task meta too. Not just the result!

androlyze.celery.CeleryUtil.write_analyze_task_results_to_fs(storage, group_result, chunked=False)[source]

Get successful task results and write them to disk if enabled.

Parameters:

storage: RedundantStorage

group_result : GroupResult

chunked : bool, optional (default is False)

If work has been divided into chunks.

Returns:

int

Number of successful tasks

androlyze.celery.TaskCollection module

class androlyze.celery.TaskCollection.TaskCollection(total_cnt_apks)[source]

Bases: object

Collection of tasks (by id)

Attributes

Methods

all_tasks_published()[source]

Check if all tasks have been published

del_send_tasks()[source]
del_task_ids()[source]
del_total_cnt_apks()[source]
get_send_tasks()[source]
get_task_ids()[source]
get_total_cnt_apks()[source]
inc_send_tasks()[source]
revoke_all(*args, **kwargs)[source]

Revoke tasks

send_tasks
set_send_tasks(value)[source]
set_task_ids(value)[source]
set_total_cnt_apks(value)[source]
task_ids

list<str> - List of task ids

total_cnt_apks

int : total number of apks to analyze

androlyze.celery.celery module

androlyze.celery.celerysettings module

Module contents