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

Feature request: DelayTimer check if ID is in use #41

Open
alpha-tango-kilo opened this issue Jun 1, 2022 · 4 comments
Open

Feature request: DelayTimer check if ID is in use #41

alpha-tango-kilo opened this issue Jun 1, 2022 · 4 comments

Comments

@alpha-tango-kilo
Copy link

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

@BinChengZhao
Copy link
Owner

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?

@alpha-tango-kilo
Copy link
Author

Yeah that's fine if it needs to be async I can work with that. Thanks for your response!

@BinChengZhao
Copy link
Owner

Yeah that's fine if it needs to be async I 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.

@alpha-tango-kilo
Copy link
Author

alpha-tango-kilo commented Jun 20, 2022

It's not a problem at all! You take all the time you need, it's not a blocking issue for me :)

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

No branches or pull requests

2 participants