task¶
-
class
pytq.task.
Task
(id, input_data, nth_counter=None, left_counter=None, output_data=None, pre_process=None, post_process=None)¶ Task is the core concept for task queue application.
Parameters: - id – str or int, fingerprint of input_data.
- input_data – input data of the task.
- nth_counter – its the nth task in the entire queue.
- left_counter – there’s nth task left for the entire batch job.
- output_data – after processing, the output data you got, could includes anything, such as, raw data, status, errors.
- pre_process – a callable function for single task, will be called before the process function been called.
- post_process – a callable function for single task, will be called after the process function been called.
-
progress_msg
()¶ Generate progress message.
-
pytq.task.
none_or_is_callable
(instance, attribute, value)¶ Can be None or callable.