-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
DelayQueue::shrink_to_fit #3590
Comments
This seems like a good idea. One question is how to handle the |
@Darksonn The soon to be released |
Yeah, some solution to not break keys is going to be necessary. |
I'd be interested in working at his. I think we would need a bijective map for the |
I don't want to use a bimap because at that point you might as well just use a |
Well but we'd only need to keep the re-mapped keys in the bimap. Unless we somehow modify the |
Using a |
Hi @Darksonn! I'd like to take a stab at this if you agree with replacing Let me know what you think! |
There was some discussion on this on the Tokio discord a few weeks ago. I would encourage you to read it. @b-naber maybe you can summarize? |
Thanks for your reply, I think I might have found the discussion you are referring to, it looks like there is progress on this issue. I'll look into something else 🙂 |
Yes, Ive already implemented this, but haven't had time to fully test it yet. Sorry for not updating the progress here, hope you haven't invested too much time into this yet, @halfzebra. |
@b-naber It looks like you've done a pretty good job so far! Thanks for working on this 👍 |
For long-lived processes, it'd be nice to be able to reclaim memory from
DelayQueue
. For example, a server may have short daily spikes in traffic, and after the spike is over, the server should try to lessen its memroy footprint.It'd be nice if
DelayQueue
offered ashrink_to_fit
method, like HashMap et all have.Perhaps the implementation of DelayQueue already takes care of this, but it wasn't clear from the documentation, so I figured I'd check!
The text was updated successfully, but these errors were encountered: