remove exit-future (#5183)

* remove exit-future usage,

as it is non maintained, and replace with async-channel which is already in the repo.

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into remove-exit-future

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into remove-exit-future
This commit is contained in:
João Oliveira
2024-02-27 22:12:44 +00:00
committed by GitHub
parent abd99652b4
commit 65c4ff0775
18 changed files with 171 additions and 193 deletions

View File

@@ -5,6 +5,7 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = { workspace = true }
[dependencies]
async-channel = { workspace = true }
tokio = { workspace = true }
slog = { workspace = true }
sloggers = { workspace = true }
@@ -17,7 +18,6 @@ slog-term = { workspace = true }
slog-async = { workspace = true }
futures = { workspace = true }
slog-json = "2.3.0"
exit-future = { workspace = true }
serde = { workspace = true }
[target.'cfg(not(target_family = "unix"))'.dependencies]

View File

@@ -343,7 +343,7 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
/// Consumes the builder, returning an `Environment`.
pub fn build(self) -> Result<Environment<E>, String> {
let (signal, exit) = exit_future::signal();
let (signal, exit) = async_channel::bounded(1);
let (signal_tx, signal_rx) = channel(1);
Ok(Environment {
runtime: self
@@ -370,8 +370,8 @@ pub struct Environment<E: EthSpec> {
signal_rx: Option<Receiver<ShutdownReason>>,
/// Sender to request shutting down.
signal_tx: Sender<ShutdownReason>,
signal: Option<exit_future::Signal>,
exit: exit_future::Exit,
signal: Option<async_channel::Sender<()>>,
exit: async_channel::Receiver<()>,
log: Logger,
sse_logging_components: Option<SSELoggingComponents>,
eth_spec_instance: E,
@@ -543,7 +543,7 @@ impl<E: EthSpec> Environment<E> {
/// Fire exit signal which shuts down all spawned services
pub fn fire_signal(&mut self) {
if let Some(signal) = self.signal.take() {
let _ = signal.fire();
drop(signal);
}
}