Skip to content

Commit e37a2c3

Browse files
committed
refactor(runtime): drop the unread LaunchContext.data_dir and comment the supervisor rebind
1 parent d0c8ff6 commit e37a2c3

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

crates/nexum-runtime/src/bootstrap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ pub async fn run<T: RuntimeTypes>(
4747
let executor = TokioExecutor;
4848
let ctx = LaunchContext {
4949
executor: &executor,
50-
data_dir: &engine_cfg.engine.state_dir,
5150
config: engine_cfg,
5251
};
5352
runtime.launch(ctx).await?.wait().await

crates/nexum-runtime/src/builder.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,10 @@ pub use crate::supervisor::WasiClockOverride;
3636
use crate::supervisor::{self, Supervisor};
3737

3838
/// Ambient inputs the imperative launcher reads: the executor that spawns the
39-
/// long-lived subscription and event-loop tasks, the resolved data directory,
40-
/// and the loaded config.
39+
/// long-lived subscription and event-loop tasks, and the loaded config.
4140
pub struct LaunchContext<'a> {
4241
/// Spawns the subscription and event-loop tasks.
4342
pub executor: &'a dyn TaskExecutor,
44-
/// Directory the backends root their on-disk state at. Advisory: the
45-
/// launcher receives pre-built backends, so it does not open the data
46-
/// directory itself; a builder that opens the backends reads the data
47-
/// directory at build time, not here.
48-
pub data_dir: &'a Path,
4943
/// The loaded engine config.
5044
pub config: &'a EngineConfig,
5145
}
@@ -261,7 +255,7 @@ impl<T: RuntimeTypes> LaunchRuntime for AssembledRuntime<'_, T> {
261255
() = signal => {},
262256
}
263257
};
264-
let mut supervisor = supervisor;
258+
let mut supervisor = supervisor; // rebind as mut: the dispatch calls below take &mut self
265259
event_loop::run(
266260
&mut supervisor,
267261
block_streams,
@@ -399,7 +393,6 @@ impl<'a, R: Runtime> PresetBuilder<'a, R> {
399393
};
400394
let ctx = LaunchContext {
401395
executor: self.executor.unwrap_or(&TokioExecutor),
402-
data_dir: &data_dir,
403396
config: self.config,
404397
};
405398
runtime.launch(ctx).await
@@ -538,7 +531,6 @@ where
538531
};
539532
let ctx = LaunchContext {
540533
executor: self.executor.unwrap_or(&TokioExecutor),
541-
data_dir: &data_dir,
542534
config: self.config,
543535
};
544536
runtime.launch(ctx).await
@@ -618,7 +610,6 @@ mod tests {
618610
let executor = TokioExecutor;
619611
let ctx = LaunchContext {
620612
executor: &executor,
621-
data_dir: &data_dir,
622613
config: &config,
623614
};
624615

0 commit comments

Comments
 (0)