mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 12:25:58 +02:00
Remove nu-glob
's dependency on nu-protocol
(#15349)
# Description This PR solves a circular dependency issue (`nu-test-support` needs `nu-glob` which needs `nu-protocol` which needs `nu-test-support`). This was done by making the glob functions that any type that implements `Interruptible` to remove the dependency on `Signals`. # After Submitting Make `Paths.next()` a O(1) operation so that cancellation/interrupt handling can be moved to the caller (e.g., by wrapping the `Paths` iterator in a cancellation iterator).
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
use crate::{ShellError, Span};
|
||||
use nu_glob::Interruptible;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Used to check for signals to suspend or terminate the execution of Nushell code.
|
||||
///
|
||||
/// For now, this struct only supports interruption (ctrl+c or SIGINT).
|
||||
@ -84,6 +84,13 @@ impl Signals {
|
||||
}
|
||||
}
|
||||
|
||||
impl Interruptible for Signals {
|
||||
#[inline]
|
||||
fn interrupted(&self) -> bool {
|
||||
self.interrupted()
|
||||
}
|
||||
}
|
||||
|
||||
/// The types of things that can be signaled. It's anticipated this will change as we learn more
|
||||
/// about how we'd like signals to be handled.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
|
Reference in New Issue
Block a user