Skip to content

Question/Feature request: Is there a way to ensure that a task is only enqueued once? #24

Description

@philippfreyer

I am using steady-queue for background task management for update signals. These signals can be paused, if a remote system is currently not reachable. If it becomes reachable again, the update signal may be rescheduled. This usually results in a lot of signals being rescheduled, though (I need to refactor that still).
However, this also means that not all tasks are processed until my next retry check happens, resulting in my queue growing out of proportion, since tasks are then enqueued again.

Is there a way to prevent that with steady-queue?
In other words: Since concurrency is already relying on a key to ensure that a version of a task is only executed once in parallel, would it be possible to use the same key to prevent enqueueing a task twice into the same queue, if it is already in the queue?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions