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

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

Open
andrewvaughan opened this issue Mar 19, 2024 · 0 comments

Comments

@andrewvaughan
Copy link

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.
    """
	# ...
@andrewvaughan andrewvaughan changed the title Allow put to place in front of Queue item Feature Request: allow before and after controls for put to fine tune placement within queue Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant