pi_portal.modules.tasks.processor.queue_maintenance.ProcessorClass

class pi_portal.modules.tasks.processor.queue_maintenance.ProcessorClass(log: Logger, router: TaskRouter)[source]

Bases: TaskProcessorBase[Args, None]

Processes requests to perform maintenance on the queue.

__init__(log: Logger, router: TaskRouter) None
log_timings(processing_start_time: datetime, task: TaskBase[TypeTaskArguments_co, TypeTaskResult]) None

Log a task’s timing data with respect to it’s processing start time.

Parameters:
  • processing_start_time (datetime) – The time at which processing began.

  • task (TaskBase[TypeTaskArguments_co, TypeTaskResult]) – The task to log timing data for.

process(task: TaskBase[TypeTaskArguments_co, TypeTaskResult]) None

Invoke the task capturing any thrown exception internally.

Parameters:

task (TaskBase[TypeTaskArguments_co, TypeTaskResult]) – The task to process.

recover(task: TaskBase[TypeTaskArguments_co, TypeTaskResult]) None

Log a message to indicate this partially failed task is recovered.

Parameters:

task (TaskBase[TypeTaskArguments_co, TypeTaskResult]) – The task to process.