Skip to content

Commit

Permalink
build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Apr 23, 2024
1 parent f98436a commit 420e38b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion zenoh/src/api/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
use super::sealed::{PluginsManager, PLUGIN_PREFIX};
use super::plugins::{PluginsManager, PLUGIN_PREFIX};
use crate::runtime::Runtime;
use zenoh_config::{Config, PluginLoad};
use zenoh_result::ZResult;
Expand Down
3 changes: 3 additions & 0 deletions zenoh/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub(crate) mod info;
pub(crate) mod key_expr;
#[cfg(feature = "unstable")]
pub(crate) mod liveliness;
#[cfg(all(feature = "unstable", feature = "plugins"))]
pub(crate) mod plugins;
pub(crate) mod publication;
pub(crate) mod query;
Expand All @@ -34,3 +35,5 @@ pub(crate) mod session;
pub(crate) mod subscriber;
pub(crate) mod time;
pub(crate) mod value;
#[cfg(all(feature = "unstable", feature = "plugins"))]
pub(crate) mod loader;
3 changes: 2 additions & 1 deletion zenoh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ extern crate zenoh_result;
mod api;
mod net;


#[cfg(all(feature = "unstable", feature = "shared-memory"))]
pub use zenoh_shm::api as shm;
#[cfg(all(feature = "unstable", feature = "shared-memory"))]
Expand Down Expand Up @@ -329,6 +328,7 @@ pub mod time {
/// This operation is used by the plugins to share the same Runtime as the router.
#[doc(hidden)]
pub mod runtime {
pub use crate::net::runtime::RuntimeBuilder;
pub use crate::net::runtime::{AdminSpace, Runtime};
pub use zenoh_runtime::ZRuntime;
}
Expand All @@ -343,6 +343,7 @@ pub mod config {
}

#[doc(hidden)]
#[cfg(all(feature = "unstable", feature = "plugins"))]
pub mod plugins {
pub use crate::api::plugins::PluginsManager;
pub use crate::api::plugins::Response;
Expand Down
13 changes: 4 additions & 9 deletions zenoh/src/net/runtime/adminspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,13 @@ use super::Runtime;
use crate::api::builders::sample::ValueBuilderTrait;
use crate::api::bytes::ZBytes;
use crate::api::key_expr::KeyExpr;
use crate::api::plugins;
#[cfg(all(feature = "unstable", feature = "plugins"))]
use crate::api::plugins::PluginsManager;
use crate::api::queryable::Query;
use crate::api::queryable::QueryInner;
use crate::api::value::Value;
use crate::encoding::Encoding;
use crate::net::primitives::Primitives;
#[cfg(all(feature = "unstable", feature = "plugins"))]
use crate::plugins::sealed::{self as plugins};
use crate::prelude::sync::SyncResolve;
use crate::queryable::Query;
use crate::queryable::QueryInner;
use crate::sample::builder::ValueBuilderTrait;
use crate::value::Value;
use serde_json::json;
use std::collections::HashMap;
use std::convert::TryFrom;
Expand All @@ -37,6 +31,7 @@ use std::sync::Mutex;
use tracing::{error, trace};
use zenoh_buffers::buffer::SplitBuffer;
use zenoh_config::{unwrap_or_default, ConfigValidator, ValidatedMap, WhatAmI};
use zenoh_core::SyncResolve;
#[cfg(all(feature = "unstable", feature = "plugins"))]
use zenoh_plugin_trait::{PluginControl, PluginStatus};
#[cfg(all(feature = "unstable", feature = "plugins"))]
Expand Down Expand Up @@ -109,7 +104,7 @@ impl ConfigValidator for AdminSpace {
impl AdminSpace {
#[cfg(all(feature = "unstable", feature = "plugins"))]
fn start_plugin(
plugin_mgr: &mut plugins::PluginsManager,
plugin_mgr: &mut PluginsManager,
config: &zenoh_config::PluginLoad,
start_args: &Runtime,
required: bool,
Expand Down
9 changes: 5 additions & 4 deletions zenoh/src/net/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ pub mod orchestrator;
use super::primitives::DeMux;
use super::routing;
use super::routing::router::Router;
#[cfg(all(feature = "unstable", feature = "plugins"))]
use crate::api::loader::{load_plugins, start_plugins};
use crate::config::{unwrap_or_default, Config, ModeDependent, Notifier};
#[cfg(all(feature = "unstable", feature = "plugins"))]
use crate::plugins::sealed::PluginsManager;
use crate::api::plugins::PluginsManager;
use crate::{GIT_VERSION, LONG_VERSION};
pub use adminspace::AdminSpace;
use futures::stream::StreamExt;
Expand All @@ -39,7 +41,6 @@ use std::time::Duration;
use tokio::task::JoinHandle;
use tokio_util::sync::CancellationToken;
use uhlc::{HLCBuilder, HLC};
use zenoh_config::{unwrap_or_default, Config, ModeDependent, Notifier};
use zenoh_link::{EndPoint, Link};
use zenoh_plugin_trait::{PluginStartArgs, StructVersion};
use zenoh_protocol::core::{Locator, WhatAmI, ZenohId};
Expand Down Expand Up @@ -158,7 +159,7 @@ impl RuntimeBuilder {
#[cfg(all(feature = "unstable", feature = "plugins"))]
let plugins_manager = plugins_manager
.take()
.unwrap_or_else(|| crate::plugins::loader::load_plugins(&config));
.unwrap_or_else(|| load_plugins(&config));
// Admin space creation flag
let start_admin_space = *config.adminspace.enabled();

Expand All @@ -185,7 +186,7 @@ impl RuntimeBuilder {

// Start plugins
#[cfg(all(feature = "unstable", feature = "plugins"))]
crate::plugins::loader::start_plugins(&runtime);
start_plugins(&runtime);

// Start notifier task
let receiver = config.subscribe();
Expand Down
7 changes: 3 additions & 4 deletions zenohd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
use tracing_subscriber::EnvFilter;
use zenoh::config::EndPoint;
use zenoh::config::{Config, ModeDependentValue, PermissionsConf, PluginLoad, ValidatedMap};
use zenoh::config::{Config, ModeDependentValue, PermissionsConf, ValidatedMap};
use zenoh::core::Result;
use zenoh::plugins::PluginsManager;
use zenoh::runtime::{AdminSpace, Runtime};
use zenoh::scouting::WhatAmI;
use zenoh::core::AsyncResolve;

#[cfg(feature = "loki")]
use url::Url;
Expand Down Expand Up @@ -108,7 +107,7 @@ fn main() {
let config = config_from_args(&args);
tracing::info!("Initial conf: {}", &config);

let _session = match zenoh::open(config).res().await {
let _session = match zenoh::open(config).res_async().await {
Ok(runtime) => runtime,
Err(e) => {
println!("{e}. Exiting...");
Expand Down

0 comments on commit 420e38b

Please sign in to comment.