Skip to content

Commit

Permalink
shm examples fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Apr 25, 2024
1 parent dd6720d commit 19be246
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 21 deletions.
10 changes: 1 addition & 9 deletions examples/examples/z_alloc_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use zenoh::prelude::r#async::*;
use zenoh::shm::protocol_implementations::posix::posix_shared_memory_provider_backend::PosixSharedMemoryProviderBackend;
use zenoh::shm::protocol_implementations::posix::protocol_id::POSIX_PROTOCOL_ID;
use zenoh::shm::provider::shared_memory_provider::{
BlockOn, GarbageCollect, SharedMemoryProviderBuilder,
};
use zenoh::shm::provider::shared_memory_provider::{Deallocate, Defragment};
use zenoh::shm::provider::types::{AllocAlignment, MemoryLayout};
use zenoh::Result;

#[tokio::main]
async fn main() {
Expand All @@ -28,7 +20,7 @@ async fn main() {
run().await.unwrap()
}

async fn run() -> Result<()> {
async fn run() -> ZResult<()> {
// Construct an SHM backend
let backend = {
// NOTE: code in this block is a specific PosixSharedMemoryProviderBackend API.
Expand Down
10 changes: 0 additions & 10 deletions examples/examples/z_ping_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,7 @@
//
use clap::Parser;
use std::time::{Duration, Instant};
use zenoh::buffers::ZSlice;
use zenoh::config::Config;
use zenoh::prelude::sync::*;
use zenoh::publication::CongestionControl;
use zenoh::shm::protocol_implementations::posix::{
posix_shared_memory_provider_backend::PosixSharedMemoryProviderBackend,
protocol_id::POSIX_PROTOCOL_ID,
};
use zenoh::shm::provider::shared_memory_provider::SharedMemoryProviderBuilder;
use zenoh::shm::provider::types::AllocAlignment;
use zenoh::shm::provider::types::MemoryLayout;
use zenoh_examples::CommonArgs;

fn main() {
Expand Down
1 change: 0 additions & 1 deletion examples/examples/z_pub_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use std::time::Duration;
use zenoh::prelude::r#async::*;
use zenoh_examples::CommonArgs;

Expand Down
1 change: 0 additions & 1 deletion examples/examples/z_sub_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use clap::Parser;
use zenoh::config::Config;
use zenoh::prelude::r#async::*;
use zenoh::shm::slice::zsliceshm::zsliceshm;
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
3 changes: 3 additions & 0 deletions zenoh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ pub mod internal {
pub mod shm {
pub use zenoh_shm::api::client_storage::SharedMemoryClientStorage;
pub use zenoh_shm::api::provider::shared_memory_provider::{BlockOn, GarbageCollect};
pub use zenoh_shm::api::provider::shared_memory_provider::{Deallocate, Defragment};
pub use zenoh_shm::api::provider::types::AllocAlignment;
pub use zenoh_shm::api::provider::types::MemoryLayout;
pub use zenoh_shm::api::slice::zsliceshm::{zsliceshm, ZSliceShm};
pub use zenoh_shm::api::slice::zsliceshmmut::{zsliceshmmut, ZSliceShmMut};
pub use zenoh_shm::api::{
Expand Down

0 comments on commit 19be246

Please sign in to comment.