Back to all reviewers

Task signature methods

prowler-cloud/prowler
Based on 2 comments
Python

When chaining Celery tasks, choose the correct signature method: - Use `.s()` when a task needs the output from the previous task in the chain - Use `.si()` (immutable signature) when a task doesn't need any output from the previous task

Celery Python

Reviewer Prompt

When chaining Celery tasks, choose the correct signature method:

  • Use .s() when a task needs the output from the previous task in the chain
  • Use .si() (immutable signature) when a task doesn’t need any output from the previous task

Incorrect signature methods can cause task failures or unexpected data flow between tasks.

# Example of proper signature method usage:
chain(
    initial_task.si(param1=value1),  # First task or doesn't need previous output
    process_results.s(),  # Needs output from initial_task
    save_to_database.si(param2=value2)  # Independent task with static parameters
)
2
Comments Analyzed
Python
Primary Language
Celery
Category

Source Discussions