You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm considering adding a ctrl+c handler, but since I'm only setting a bool it might take a while until my program is actually picking it up. The application would feel broken since it can not be terminated in a reliable way even after pressing ctrl+c multiple times. I'm thinking about 2 possible solutions:
inside the signal handler, allow passing through the signal so if ctrl+c is pressed, I would first check the value of the boolean, if it is true I set it to false, if it is false, I let the signal pass and terminate the process
allow removing the signal handler. Before I start an action that should be cancelable, I register a signal handler and if ctrl+c is pressed I'm setting the boolean to false and unregister the signal handler so that the second ctrl+c isn't caught anymore (Related to allow to reset the ctrlc handler #24)
Basically I'm looking for behavior similar to this (implementation doesn't need to be identical as long as the behavior is the same):
Can you just kill the process yourself from your handler when entering the handler a second time?
Something like this results in a similar behaviour than your python example:
- Upgraded nix dependency
- Removed deprecated usages of ATOMIC_BOOL_INIT
- Removed contributors from authors field
- Formatted with latest rustfmt
- FixesDetegr#46 by including an example
I'm considering adding a ctrl+c handler, but since I'm only setting a bool it might take a while until my program is actually picking it up. The application would feel broken since it can not be terminated in a reliable way even after pressing ctrl+c multiple times. I'm thinking about 2 possible solutions:
Basically I'm looking for behavior similar to this (implementation doesn't need to be identical as long as the behavior is the same):
The text was updated successfully, but these errors were encountered: