selinon.task_envelope module

A raw Celery task that is responsible for running SelinonTask.

class selinon.task_envelope.SelinonTaskEnvelope[source]

Bases: celery.app.task.Task

A Celery task that is responsible for running user defined tasks from flow.

acks_late = True
ignore_result = False
max_retries = None
name = 'selinon.SelinonTaskEnvelope'
priority = None
rate_limit = None
reject_on_worker_lost = None
request_stack = <celery.utils.threads._LocalStack object>
run(task_name, flow_name, parent, node_args, dispatcher_id, retried_count=None)[source]

Task entry-point called by Celery.

Parameters:
  • task_name – task to be run
  • flow_name – flow in which this task run
  • parent – dict of parent nodes
  • node_args – node arguments within the flow
  • dispatcher_id – dispatcher id that handles flow
  • retried_count – number of already attempts that failed so task was retried
Return type:

None

selinon_retry(task_name, flow_name, parent, node_args, retry_countdown, retried_count, dispatcher_id, user_retry=False)[source]

Retry on Celery level.

Parameters:
  • task_name – name of the task to be retried
  • flow_name – name of in which the task was run
  • parent – dict of parent tasks
  • node_args – arguments for task
  • retry_countdown – countdown for retry
  • retried_count – number of retries already done with this task
  • dispatcher_id – ID id of dispatcher that is handling flow that run this task
  • user_retry – True if retry was forced from the user
serializer = 'json'
store_errors_even_if_ignored = False
track_started = True
typing = True
classmethod validate_result(task_name, result)[source]

Validate result of the task for the given schema, if fails an Exception is raised.

Parameters:
  • task_name – name of task
  • result – result of task