Skip to content

Commit 34d0eb0

Browse files
committed
[chore] move config to core lib
1 parent d1bf0f6 commit 34d0eb0

6 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/core/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ use std::sync::Arc;
22
use tokio::sync;
33

44
use crate::{
5-
config::Config,
5+
core::Config,
66
events::Bus,
77
subscribers::{Subscribe, SubscriberSet},
88
};
9-
109
use super::{alive::AliveTracker, registry::Registry, supervisor::Supervisor};
1110

1211
/// Builder for constructing a Supervisor with optional features.
File renamed without changes.

src/core/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,7 @@ mod registry;
106106
mod runner;
107107
mod shutdown;
108108
mod supervisor;
109+
mod config;
109110

110111
pub use supervisor::Supervisor;
112+
pub use config::Config;

src/core/supervisor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@
9191
//! ```
9292
9393
use std::{sync::Arc, time::Duration};
94-
use tokio::{sync::Notify, sync::broadcast, time::timeout};
94+
use tokio::{sync::broadcast, sync::Notify, time::timeout};
9595
use tokio_util::sync::CancellationToken;
9696

9797
#[cfg(feature = "controller")]
9898
use tokio::sync::OnceCell;
9999

100100
use crate::core::{alive::AliveTracker, builder::SupervisorBuilder, registry::Registry};
101101
use crate::{
102-
config::Config,
102+
core::Config,
103103
error::RuntimeError,
104104
events::{Bus, Event, EventKind},
105105
subscribers::{Subscribe, SubscriberSet},

src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@
148148
//! Ok(())
149149
//! }
150150
//! ```
151-
mod config;
152151
mod core;
153152
mod error;
154153
mod events;
@@ -158,8 +157,7 @@ mod tasks;
158157

159158
// ---- Public re-exports ----
160159

161-
pub use config::Config;
162-
pub use core::Supervisor;
160+
pub use core::{Supervisor, Config};
163161
pub use error::{RuntimeError, TaskError};
164162
pub use events::{BackoffSource, Event, EventKind};
165163
pub use policies::{BackoffPolicy, JitterPolicy, RestartPolicy};

src/tasks/spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use std::time::Duration;
1414

1515
use crate::{
16-
config::Config, policies::BackoffPolicy, policies::RestartPolicy, tasks::task::TaskRef,
16+
core::Config, policies::BackoffPolicy, policies::RestartPolicy, tasks::task::TaskRef,
1717
};
1818

1919
/// Specification for running a task under supervision.

0 commit comments

Comments
 (0)