Skip to content

Commit

Permalink
feature/nanocld: event manager (#801)
Browse files Browse the repository at this point in the history
* feature/nanocld: event manager
  • Loading branch information
leon3s authored Jan 5, 2024
1 parent 7be1d44 commit d59a45b
Show file tree
Hide file tree
Showing 46 changed files with 832 additions and 749 deletions.
205 changes: 0 additions & 205 deletions bin/nanocld/src/event_emitter.rs

This file was deleted.

14 changes: 6 additions & 8 deletions bin/nanocld/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ use nanocl_utils::logger;
mod cli;
mod config;
mod schema;
mod version;
mod boot;
mod models;
mod event_emitter;
mod server;
mod repositories;
mod version;
mod utils;
mod subsystem;
mod repositories;
mod services;

/// Provides an api to manage containers and virtual machines accross physical hosts
Expand Down Expand Up @@ -45,16 +43,16 @@ async fn main() -> std::io::Result<()> {
Ok(config) => config,
};
// Boot internal dependencies (database, event bus, etc...)
let daemon_state = match boot::init(&config).await {
let daemon_state = match subsystem::init(&config).await {
Err(err) => {
err.print_and_exit();
}
Ok(daemon_state) => daemon_state,
};
// Start http server
match server::gen(daemon_state).await {
match utils::server::gen(daemon_state).await {
Err(err) => {
err.map_err_context(|| "Daemon state").print_and_exit();
err.map_err_context(|| "Http server").print_and_exit();
}
Ok(server) => {
// Start http server and wait for shutdown
Expand Down
7 changes: 5 additions & 2 deletions bin/nanocld/src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pub use ws::*;
mod node;
pub use node::*;

mod state;
pub use state::*;
mod system;
pub use system::*;

mod metric;
pub use metric::*;
Expand Down Expand Up @@ -48,6 +48,9 @@ pub use process::*;
mod event;
pub use event::*;

mod raw_emitter;
pub use raw_emitter::*;

pub type Pool = Arc<R2D2Pool<ConnectionManager<PgConnection>>>;
pub type DBConn = PooledConnection<ConnectionManager<PgConnection>>;

Expand Down
Loading

0 comments on commit d59a45b

Please sign in to comment.