Skip to content

Conversation

@miky-rola
Copy link
Contributor

  • Add function to shutdown server without any dependencies

@Az107 Az107 linked an issue Apr 11, 2025 that may be closed by this pull request
@Az107
Copy link
Owner

Az107 commented Apr 11, 2025

Amazing job!
Give me some time to review this and run a few tests before merging.
But this looks really impressive!

Copy link
Owner

@Az107 Az107 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a great job , but a couple of request.
first we can move this methods and mods about the graceful shutdown to a mod in
maybe src/utils.rs or its own.
For the unix implementation its better to finally use libc
that will reduce it to something more like the windows one

extern "C" fn handle_sigint(_: i32) {
    println!("\SIGINT recibed (Ctrl+C). Quiting...");
    std::process::exit(0);
}

    unsafe {
        libc::signal(libc::SIGINT, handle_sigint as usize);
    }

Copy link
Owner

@Az107 Az107 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Az107 Az107 merged commit a76132f into Az107:master Apr 13, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

Close server gracefully

3 participants