MCPcopy Create free account
hub / github.com/Proryanator/encoder-benchmark / was_ctrl_c_received

Function was_ctrl_c_received

engine/src/threads.rs:4–13  ·  view source on GitHub ↗
(ctrl_c_events: &Result<Receiver<()>, Error>)

Source from the content-addressed store, hash-verified

2use ctrlc::Error;
3
4pub fn was_ctrl_c_received(ctrl_c_events: &Result<Receiver<()>, Error>) -> bool {
5 select! {
6 recv(ctrl_c_events.as_ref().unwrap()) -> _ => {
7 return true;
8 },
9 default() => {
10 return false;
11 }
12 }
13}
14
15pub fn exit_on_ctrl_c(ctrl_channel: &Result<Receiver<()>, Error>) {
16 if was_ctrl_c_received(&ctrl_channel) {

Callers 2

exit_on_ctrl_cFunction · 0.85
run_overload_benchmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected