Skip to content

Feature Request: allow before and after controls for put to fine tune placement within queue #211

@andrewvaughan

Description

@andrewvaughan

Feature request: add an optional argument to allow put to place at specific points in the queue. For example:

def put(self, item: Any, before: int | None = None, after: int | None = None) -> int | None:
    """Put an item onto the queue.
    
    By default, items are placed onto the end of the queue.

    Args:
        item (Any): The item to enqueue.
        before: (int | None, optional): The id of the item to place this item before; may not be used with `after`. Defaults to None.
        after: (int | None, optional): The id of the item to place this item after; may not be used with `before`. Defaults to None.

    Raises:
        ValueError: if both `before` and `after` are set in the same call.
    """
	# ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions