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

How to avoid duplicates? #65

Closed
rogerweb opened this issue Apr 16, 2024 · 1 comment · Fixed by #67
Closed

How to avoid duplicates? #65

rogerweb opened this issue Apr 16, 2024 · 1 comment · Fixed by #67
Assignees

Comments

@rogerweb
Copy link

My application watches a directory for new files and add them to a MinPriorityQueue so a worker can process them in order. However, a user may resend the same file, overwriting it in the filesystem while its name is still in the queue. This results in having one file in the filesystem but two in the queue.

I would like to prevent adding an element to the queue if it is already present.

I understand a "contains" method is not typically part the queue paradigm, but since we already have the "remove" method, I'm considering whether a "contains" or "includes" method could also be exposed.

Thanks!

@eyas-ranjous eyas-ranjous self-assigned this Jul 14, 2024
@eyas-ranjous eyas-ranjous linked a pull request Jul 14, 2024 that will close this issue
@rogerweb
Copy link
Author

Thank you @eyas-ranjous !

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

Successfully merging a pull request may close this issue.

2 participants