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

feat(api): provide a API that has progress callback hooks #117

Open
sassman opened this issue Sep 11, 2023 · 0 comments
Open

feat(api): provide a API that has progress callback hooks #117

sassman opened this issue Sep 11, 2023 · 0 comments

Comments

@sassman
Copy link
Member

sassman commented Sep 11, 2023

A as API User
I want to register a progress update callback hook
So that I can easily implement a progress bar

Acceptance Criteria

  • The hook should be a simple function
  • The hook should accept a f32 argument that indicates the progress, with range 0..1
  • The hook should accept a argument that allows to cancel and interrupt the process

Example

This is the progress update callback that I want to register:

fn progress_update(progress: f32, should_cancel: &mut bool) {
    // let's print the current progress as percent 0..100 
    println!("Current Progress: {}", (progress * 100.0).floor());
    // let's cancel the progress
    *should_cancel = true;
}
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

1 participant