Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Issues: revoke_by_stamped_headers Function Name and Incomplete Stamped Headers Documentation #9451

Open
4 tasks done
1gsmith opened this issue Dec 4, 2024 · 0 comments

Comments

@1gsmith
Copy link

1gsmith commented Dec 4, 2024

Checklist

  • I have checked the issues list for similar or identical bug reports.
  • I have checked the pull requests list for existing proposed fixes.
  • I have checked the commit log to find out if the bug was already fixed in the main branch.
  • I have included all related issues and possible duplicate issues in this issue.

Related Issues and Possible Duplicates

Related Issues

  • None

Possible Duplicates

  • None

Description

There are several issues with the documentation regarding stamped headers:

  1. Function Name Mismatch:

    • Documentation refers to revoke_by_stamped_header
    • Actual function name is revoke_by_stamped_headers (plural)
  2. Unclear Documentation for apply_async:

    • Current docs only mention "headers (Dict) – Message headers to be included in the message"
    • stamps and stamped headers are not mentioned
    • No comprehensive example of how to use stamped headers for task revocation

Suggestions

  1. Fix the function name in documentation to revoke_by_stamped_headers
  2. Update the apply_async documentation to include stamped headers:
    • Current: only mentions "headers (Dict) – Message headers to be included in the message"
    • Should add:
      • stamped_headers (List) – Names of headers to be stamped for task tracking/revocation
      • stamps – Values for the stamped headers specified in stamped_headers
  3. Add clear explanation of stamped headers concepts:
# Example implementation
def start_process():
    process_id = generate_process_id()
    timestamp = timezone.now()
    
    # Start task with stamped headers
    task = process_task.apply_async(
        kwargs={'process_id': process_id},
        stamped_headers=['batch_id'],    # List of header names to stamp
        batch_id=str(timestamp)          # The actual stamp value
    )
def stop_process(batch_id):
    # Revoke all tasks with matching stamp
    result = app.control.revoke_by_stamped_headers(
        {'batch_id': ['batch_id']},
        terminate=True
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant