delay-timer
delay-timer copied to clipboard
Feature request: `DelayTimer` check if ID is in use
Is your feature request related to a problem? Please describe.
I'd like to be able to check if a task with a specific ID is already being handled by DelayTimer, so I can avoid overwriting accidentally by inserting a new task with the same ID
Describe the solution you'd like
impl DelayTimer {
pub fn has_task(&self, id: u64) -> bool {
todo!()
}
}
Describe alternatives you've considered
A workaround I considered was trying to remove a task then re-adding it if it existed, however DelayTimer::remove_task doesn't return the task being removed
Additional context For use in my upcoming project
alpha-tango-kilo
My friend, I got your description of your needs, Since getting an internal state is an asynchronous process, can add this API, but it needs to be called asynchronously. Is this convenient for you to call?
Yeah that's fine if it needs to be async I can work with that. Thanks for your response!
Yeah that's fine if it needs to be
asyncI can work with that. Thanks for your response!
I'm sorry to say that I've been very busy lately, but if I have time I'll help you implement this API, thank you for your understanding.
It's not a problem at all! You take all the time you need, it's not a blocking issue for me :)