You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: