Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC: SHM watchdog #596

Closed
Closed
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
20d5b26
add watchdog codebase
yellowhatter Nov 14, 2023
9bee417
integrated and tested POC
yellowhatter Nov 20, 2023
b78336b
[skip ci] Merge commit '1daaaf512c575b55042b88aa76be94205a93611c'
yellowhatter Nov 21, 2023
d521c05
Merge commit '780ec606ba4000a17b2da0e2b0b668e11d37c65e'
yellowhatter Dec 15, 2023
f643f93
Update shm.rs
yellowhatter Dec 15, 2023
f7d053c
WIP: implemented buffer headers in separate SHM segment, made buffer …
yellowhatter Dec 21, 2023
5523201
- refactored POSIX shm wrapper
yellowhatter Dec 21, 2023
bc202a3
- use posix_shm module for data segment in SharedMemoryManager
yellowhatter Dec 22, 2023
26e0ac5
Merge commit 'd8c27a6e017938f4435d5abea4a0142c9d23ff59'
yellowhatter Dec 22, 2023
0c1e385
WIP on SHM
yellowhatter Jan 11, 2024
43b5391
Fix clippy, additional improvements
yellowhatter Jan 11, 2024
c5e34c0
Sync lockfiles (#646)
fuzzypixelz Jan 15, 2024
2086eb6
Fix potential panic when Stats drops (#642)
jerry73204 Jan 15, 2024
1b9a576
fix: Incorrect lockfile URL (#647)
fuzzypixelz Jan 15, 2024
40d1c1e
Fix workflow sync lockfiles (2) (#648)
fuzzypixelz Jan 15, 2024
b669489
fix: Don't auto-approve the pull request (#649)
fuzzypixelz Jan 15, 2024
fcc064f
Implement watchdog periodic tasks with optional realtime scheduling
yellowhatter Jan 16, 2024
00a4d1d
[skip ci] WIP on SHM provider\client API
yellowhatter Jan 18, 2024
3ccab12
[skip ci] WIP on SHM API
yellowhatter Jan 22, 2024
2fa05c6
Merge commit 'b669489bc814a758741f09c671ecc3a0683697a0'
yellowhatter Jan 22, 2024
2e3aedf
Align the name of zenoh-plugin-example and set the used unstable feat…
YuanYuYuan Jan 23, 2024
05c7a3e
Add a CallbackPair handler implementing Drop and IntoCallbackReceiver…
JEnoch Jan 23, 2024
c6d7257
Verbatim chunks for Key Expressions (#655)
p-avital Jan 23, 2024
8d7a634
plugin API rework, plugin status support (#583)
milyin Jan 23, 2024
8cd786f
Remove `gen_zenoh_deb.sh` (#659)
fuzzypixelz Jan 24, 2024
eb608c9
[skip ci] Big WIP on SHM API integration
yellowhatter Jan 24, 2024
4f03fc7
Able to unwrap while using reply with attachment. (#658)
evshary Jan 25, 2024
eddf371
Improve project management (#674)
fuzzypixelz Jan 25, 2024
561c02d
Fix matching_status_* test failures (#662)
YuanYuYuan Jan 26, 2024
bb323ae
Improve project mangement (follow-up) (#676)
fuzzypixelz Jan 26, 2024
0943243
Improve project management (follow-up) (#681)
fuzzypixelz Jan 26, 2024
5ee84e7
[skip ci] working SHM (tests passing)
yellowhatter Jan 26, 2024
e234699
Merge commit '0943243da1a9eb14644897b13934be25610c4a94'
yellowhatter Jan 26, 2024
1b86de3
complete option added, SessionRef refactor
milyin Jan 26, 2024
1d743e8
command lipe parse crash fix
milyin Jan 26, 2024
0b6d65d
Improve project mangement (2) (#696)
fuzzypixelz Jan 30, 2024
d42b4bb
Merge branch 'main' into pubcache_complete
milyin Jan 30, 2024
ec1c22a
parametrized SessionDeclarations
milyin Jan 30, 2024
0c202a6
separated lifetimes for source and result
milyin Jan 31, 2024
0111ed7
comments updated
milyin Jan 31, 2024
09a72ff
moved SessionDeclaration to end to simplify review
milyin Jan 31, 2024
1de9d36
Examples: fix overwritten mode in config file (fix #700) (#702)
JEnoch Jan 31, 2024
71e224e
Remove forgotten println! from #702 (#707)
Mallets Jan 31, 2024
5601669
Router reorg (#587)
OlivierHecart Jan 31, 2024
e8dca1e
Merge pull request #688 from eclipse-zenoh/pubcache_complete
milyin Feb 2, 2024
db4036a
[skip ci] WIP on API
yellowhatter Feb 5, 2024
6e07611
Merge commit 'e8dca1e0ac7036ee04ab024115d418224492343d'
yellowhatter Feb 5, 2024
6ecb009
Correct the tx threads in the example config (#720)
YuanYuYuan Feb 7, 2024
634ad71
add support for verbatims in ketrees (#706)
p-avital Feb 7, 2024
2bd4518
Make cargo-nextest more resilient (#715)
YuanYuYuan Feb 7, 2024
6d05776
[skip ci] WIP on SHM API
yellowhatter Feb 8, 2024
fc31e7d
Merge commit '2bd4518334d0a9e7e2703c7fd57dfa4547a96819'
yellowhatter Feb 8, 2024
8433384
Add interfaces to the Link (#718)
sashacmc Feb 9, 2024
f62ff68
Remove `zenoh-examples` Debian package (#723)
fuzzypixelz Feb 9, 2024
26c55a9
-expose qos data in Sample
DenisBiryukov91 Feb 9, 2024
239b4ac
format
DenisBiryukov91 Feb 9, 2024
c09a6a4
typo fix
DenisBiryukov91 Feb 9, 2024
84dc04a
Queries duplicates fix (#733)
OlivierHecart Feb 12, 2024
9c26273
cleanup tests/qos
DenisBiryukov91 Feb 13, 2024
df05068
moved public QoS type to Sample.rs
DenisBiryukov91 Feb 13, 2024
dfe3d4a
Specify windows char escape in README (#735)
Mallets Feb 13, 2024
b90fc73
account for the possibility of failure when converting from ext::QoST…
DenisBiryukov91 Feb 13, 2024
3028518
QoS.from_or_default to replace only priority value by default one in …
DenisBiryukov91 Feb 13, 2024
03831f4
typo fix
DenisBiryukov91 Feb 13, 2024
2f21cfb
reduce priority of logging to trace, in case we fail to conver protoc…
DenisBiryukov91 Feb 14, 2024
40efd99
Adding the ability to return an error from the interceptors factory (…
sashacmc Feb 14, 2024
078898d
Add the downsampling interceptor (#728)
sashacmc Feb 15, 2024
f09fcc2
Fix Release workflow (#734)
fuzzypixelz Feb 15, 2024
2dc3991
WIP on API
yellowhatter Feb 16, 2024
7ebdb3c
Add ingress downsampling tests (#741)
sashacmc Feb 16, 2024
e48ea54
Merge branch 'eclipse-zenoh:main' into feature/priority-in-sample
DenisBiryukov91 Feb 16, 2024
b65a575
Merge commit '7ebdb3cab481609989f1e9d3124e75d2851458e5'
yellowhatter Feb 19, 2024
85d8769
reduce size of QoS struct
DenisBiryukov91 Feb 19, 2024
eb79877
- add docstrings
DenisBiryukov91 Feb 19, 2024
061008f
add qos setters
DenisBiryukov91 Feb 20, 2024
60ba702
build plugins with default zenoh features
milyin Feb 21, 2024
90d1b76
fix clippy warnings
DenisBiryukov91 Feb 21, 2024
743b081
- added SharedMemoryReader to Session and Runtime building API
yellowhatter Feb 21, 2024
0067f63
[skip ci] correct shm establish logic
yellowhatter Feb 22, 2024
1f1fabd
Remove SharedMemoryFactory
yellowhatter Feb 22, 2024
0440148
Merge pull request #730 from DenisBiryukov91/feature/priority-in-sample
milyin Feb 23, 2024
d48f00a
fix: Disable debug information in CI workflow (#754)
fuzzypixelz Feb 23, 2024
42f9384
links refactoring (#748)
sashacmc Feb 23, 2024
3f2e8db
[skip ci]
yellowhatter Feb 23, 2024
7d9d684
verbatim and intersect supports added to keformat (#752)
p-avital Feb 26, 2024
90617ff
Add possibility to binding on the interface (#755)
sashacmc Feb 27, 2024
149ba73
[skip ci] Final updates to SHM provider API
yellowhatter Feb 27, 2024
0acd83d
Merge commit '90617ff606b6d4c89d1a3f166dcee6a2b7d5461a'
yellowhatter Feb 27, 2024
01ae772
Update DEFAULT_CONFIG.json5 with iface binding (#767)
sashacmc Feb 28, 2024
bbb9f94
chore: Bump create-pull-request from v5 to v6 (#777)
fuzzypixelz Mar 1, 2024
fa40a4d
fix User-Password authentication (#776)
vivekpandey02 Mar 1, 2024
4e3a3d0
ZSlice: safe mutable acces to inner contents and support for copy-on-…
yellowhatter Mar 1, 2024
200dd28
feat: Support `.yml` configuration files (#784)
fuzzypixelz Mar 4, 2024
a1cf2be
Interceptors caches (#744)
OlivierHecart Mar 4, 2024
7b6ca9c
fix: Set `publish = false` for zenoh-backend-example (#787)
fuzzypixelz Mar 5, 2024
dffa0a2
fix: Set `fail-fast = false` in sync-lockfiles workflow (#780)
fuzzypixelz Mar 5, 2024
8730335
fix: Remove unused dependencies (#761)
fuzzypixelz Mar 5, 2024
ac45542
fix: Use `clippy` from Stable Rust (#766)
fuzzypixelz Mar 5, 2024
c80124a
Implement get_interface_names for serial link (#772)
sashacmc Mar 5, 2024
e6025ec
[skip ci]
yellowhatter Mar 5, 2024
f2e99b6
Update downsampling interceptor (#788)
sashacmc Mar 5, 2024
9d69725
Merge commit 'f2e99b6fe07bf7899a458e0a16bfe85e3cdebca6'
yellowhatter Mar 6, 2024
172288e
feat: Support non-default branch in sync-lockfiles workflow
fuzzypixelz Mar 6, 2024
7c1e0c7
Merge pull request #794 from fuzzypixelz/feat-sync-lockfiles-from-branch
gabrik Mar 6, 2024
dd35bb5
fix: Remove (more) unsued dependencies (#798)
fuzzypixelz Mar 7, 2024
3328edb
fix: Remove `clap` 4.x from `zenoh-plugin-storage-manager`'s dep tree…
fuzzypixelz Mar 7, 2024
2e79208
Fix liveliness bug (#802)
OlivierHecart Mar 8, 2024
4537dc2
fix: Resolve Nightly Rustdoc errors and warnings (#792)
fuzzypixelz Mar 8, 2024
c9ef86e
[skip ci]
yellowhatter Mar 11, 2024
8328652
[skip ci]
yellowhatter Mar 11, 2024
9177fb3
[skip ci]
yellowhatter Mar 12, 2024
6045bfe
update documentation to the new api for keformat's generated Parsed (…
p-avital Mar 13, 2024
c12c005
fix: Relax dependency requirements (#758)
fuzzypixelz Mar 13, 2024
ceb982d
feat: Improve release workflow (#756)
fuzzypixelz Mar 13, 2024
1acb511
Merge branch 'main' into default_features_fix
milyin Mar 13, 2024
63965fc
Merge pull request #745 from eclipse-zenoh/default_features_fix
milyin Mar 13, 2024
1c8ed89
restore SN in case of frame drops caused by congestion control (#815)
yellowhatter Mar 13, 2024
f4b86f0
Merge commit '1c8ed89b659a2eb9561684602a03390c4f46e279'
yellowhatter Mar 13, 2024
4dd2611
Solved additive feature problem
yellowhatter Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
103 changes: 103 additions & 0 deletions .github/workflows/sync-lockfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Sync Cargo lockfile with Zenoh's dependants

on:
schedule:
- cron: "0 0 * * *" # At the end of every day
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
fetch:
name: Fetch Zenoh's lockfile
runs-on: ubuntu-latest
steps:
- name: Checkout Zenoh
uses: actions/checkout@v4
with:
repository: eclipse-zenoh/zenoh

- name: Upload lockfile
uses: actions/upload-artifact@v3
with:
name: Cargo.lock
path: Cargo.lock

sync:
name: Sync Cargo lockfile with ${{ matrix.dependant }}
needs: fetch
runs-on: ubuntu-latest
strategy:
matrix:
dependant:
- zenoh-c
- zenoh-python
- zenoh-java
- zenoh-kotlin
- zenoh-plugin-dds
- zenoh-plugin-mqtt
- zenoh-plugin-ros1
- zenoh-plugin-ros2dds
- zenoh-plugin-webserver
- zenoh-backend-filesystem
- zenoh-backend-influxdb
- zenoh-backend-rocksdb
- zenoh-backend-s3
steps:
- name: Checkout ${{ matrix.dependant }}
uses: actions/checkout@v4
with:
repository: eclipse-zenoh/${{ matrix.dependant }}
submodules: true
token: ${{ secrets.BOT_TOKEN_WORKFLOW }}

- name: Install Rust toolchain
# NOTE: Showing the active Rust toolchain (defined by the rust-toolchain.toml file)
# will have the side effect of installing it; if it's not installed already.
run: rustup show

# NOTE: Not all Zenoh dependants have their Cargo manifest and lockfile
# at the repository's toplevel. The only exception being zenoh-kotlin and
# zenoh-java. Thus the need for this ugly workaround.
- name: Compute crate path of ${{ matrix.dependant }}
id: crate-path
run: |
if [[ "${{ matrix.dependant }}" =~ zenoh-(java|kotlin) ]]; then
echo "value=zenoh-jni" >> $GITHUB_OUTPUT
else
echo "value=." >> $GITHUB_OUTPUT
fi

- name: Override ${{ matrix.dependant }} lockfile with Zenoh's
uses: actions/download-artifact@v3
with:
name: Cargo.lock
path: ${{ steps.crate-path.outputs.value }}

- name: Rectify lockfile
# NOTE: Checking the package for errors will rectify the Cargo.lock while preserving
# the dependency versions fetched from source.
run: cargo check --manifest-path ${{ steps.crate-path.outputs.value }}/Cargo.toml

- name: Create/Update a pull request if the lockfile changed
id: cpr
# NOTE: If there is a pending PR, this action will simply update it with a forced push.
uses: peter-evans/create-pull-request@v5
with:
title: Sync lockfile with Zenoh's
body: Automated synchronization of the Cargo lockfile with Zenoh. This is done to ensure plugin ABI compatibility.
commit-message: "chore: Sync Cargo lockfile with Zenoh's"
committer: eclipse-zenoh-bot <[email protected]>
author: eclipse-zenoh-bot <[email protected]>
branch: eclipse-zenoh-bot/sync-lockfile
delete-branch: true
labels: dependencies
token: ${{ secrets.BOT_TOKEN_WORKFLOW }}

- name: Enable auto merge for the pull request
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr merge -R "eclipse-zenoh/${{ matrix.dependant }}" --merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN_WORKFLOW }}
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ log = "0.4.17"
lz4_flex = "0.11"
nix = { version = "0.27", features = ["fs"] }
num_cpus = "1.15.0"
num-traits = { version = "0.2.17", default-features = false }
ordered-float = "4.1.1"
panic-message = "0.3.0"
paste = "1.0.12"
Expand Down
134 changes: 120 additions & 14 deletions commons/zenoh-codec/src/core/shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,50 @@ use zenoh_buffers::{
reader::{DidntRead, Reader},
writer::{DidntWrite, Writer},
};
use zenoh_shm::SharedMemoryBufInfo;
use zenoh_shm::{
api::provider::chunk::ChunkDescriptor, header::descriptor::HeaderDescriptor,
watchdog::descriptor::Descriptor, SharedMemoryBufInfo,
};

impl<W> WCodec<&Descriptor, &mut W> for Zenoh080
where
W: Writer,
{
type Output = Result<(), DidntWrite>;

fn write(self, writer: &mut W, x: &Descriptor) -> Self::Output {
self.write(&mut *writer, x.id)?;
self.write(&mut *writer, x.index_and_bitpos)?;
Ok(())
}
}

impl<W> WCodec<&HeaderDescriptor, &mut W> for Zenoh080
where
W: Writer,
{
type Output = Result<(), DidntWrite>;

fn write(self, writer: &mut W, x: &HeaderDescriptor) -> Self::Output {
self.write(&mut *writer, x.id)?;
self.write(&mut *writer, x.index)?;
Ok(())
}
}

impl<W> WCodec<&ChunkDescriptor, &mut W> for Zenoh080
where
W: Writer,
{
type Output = Result<(), DidntWrite>;

fn write(self, writer: &mut W, x: &ChunkDescriptor) -> Self::Output {
self.write(&mut *writer, x.segment)?;
self.write(&mut *writer, x.chunk)?;
self.write(&mut *writer, x.len)?;
Ok(())
}
}

impl<W> WCodec<&SharedMemoryBufInfo, &mut W> for Zenoh080
where
Expand All @@ -26,33 +69,96 @@ where

fn write(self, writer: &mut W, x: &SharedMemoryBufInfo) -> Self::Output {
let SharedMemoryBufInfo {
offset,
length,
shm_manager,
kind,
data_descriptor,
shm_protocol,
data_len,
watchdog_descriptor,
header_descriptor,
generation,
} = x;

self.write(&mut *writer, offset)?;
self.write(&mut *writer, length)?;
self.write(&mut *writer, shm_manager.as_str())?;
self.write(&mut *writer, kind)?;
self.write(&mut *writer, data_descriptor)?;
self.write(&mut *writer, shm_protocol)?;
self.write(&mut *writer, data_len)?;
self.write(&mut *writer, watchdog_descriptor)?;
self.write(&mut *writer, header_descriptor)?;
self.write(&mut *writer, generation)?;
Ok(())
}
}

impl<R> RCodec<Descriptor, &mut R> for Zenoh080
where
R: Reader,
{
type Error = DidntRead;

fn read(self, reader: &mut R) -> Result<Descriptor, Self::Error> {
let id = self.read(&mut *reader)?;
let index_and_bitpos = self.read(&mut *reader)?;

Ok(Descriptor {
id,
index_and_bitpos,
})
}
}

impl<R> RCodec<HeaderDescriptor, &mut R> for Zenoh080
where
R: Reader,
{
type Error = DidntRead;

fn read(self, reader: &mut R) -> Result<HeaderDescriptor, Self::Error> {
let id = self.read(&mut *reader)?;
let index = self.read(&mut *reader)?;

Ok(HeaderDescriptor { id, index })
}
}

impl<R> RCodec<ChunkDescriptor, &mut R> for Zenoh080
where
R: Reader,
{
type Error = DidntRead;

fn read(self, reader: &mut R) -> Result<ChunkDescriptor, Self::Error> {
let segment = self.read(&mut *reader)?;
let chunk = self.read(&mut *reader)?;
let len = self.read(&mut *reader)?;

Ok(ChunkDescriptor {
segment,
chunk,
len,
})
}
}

impl<R> RCodec<SharedMemoryBufInfo, &mut R> for Zenoh080
where
R: Reader,
{
type Error = DidntRead;

fn read(self, reader: &mut R) -> Result<SharedMemoryBufInfo, Self::Error> {
let offset: usize = self.read(&mut *reader)?;
let length: usize = self.read(&mut *reader)?;
let shm_manager: String = self.read(&mut *reader)?;
let kind: u8 = self.read(&mut *reader)?;
let data_descriptor = self.read(&mut *reader)?;
let shm_protocol = self.read(&mut *reader)?;
let data_len = self.read(&mut *reader)?;
let watchdog_descriptor = self.read(&mut *reader)?;
let header_descriptor = self.read(&mut *reader)?;
let generation = self.read(&mut *reader)?;

let shm_info = SharedMemoryBufInfo::new(offset, length, shm_manager, kind);
let shm_info = SharedMemoryBufInfo::new(
data_descriptor,
shm_protocol,
data_len,
watchdog_descriptor,
header_descriptor,
generation,
);
Ok(shm_info)
}
}
15 changes: 12 additions & 3 deletions commons/zenoh-codec/tests/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,24 @@ fn codec_encoding() {
#[cfg(feature = "shared-memory")]
#[test]
fn codec_shm_info() {
use zenoh_shm::SharedMemoryBufInfo;
use zenoh_shm::api::provider::chunk::ChunkDescriptor;
use zenoh_shm::header::descriptor::HeaderDescriptor;
use zenoh_shm::{watchdog::descriptor::Descriptor, SharedMemoryBufInfo};

run!(SharedMemoryBufInfo, {
let mut rng = rand::thread_rng();
let len = rng.gen_range(0..16);
SharedMemoryBufInfo::new(
ChunkDescriptor::new(rng.gen(), rng.gen(), rng.gen()),
rng.gen(),
rng.gen(),
Alphanumeric.sample_string(&mut rng, len),
Descriptor {
id: rng.gen(),
index_and_bitpos: rng.gen(),
},
HeaderDescriptor {
id: rng.gen(),
index: rng.gen(),
},
rng.gen(),
)
});
Expand Down
13 changes: 13 additions & 0 deletions commons/zenoh-shm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,23 @@ categories = { workspace = true }
description = "Internal crate for zenoh."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
test = ["num_cpus"]

[dependencies]
bincode = { workspace = true }
log = { workspace = true }
serde = { workspace = true, features = ["default"] }
shared_memory = { workspace = true }
zenoh-buffers = { workspace = true }
zenoh-result = { workspace = true }
rand = { workspace = true }
lazy_static = { workspace = true }
num-traits = { workspace = true }
num_cpus = { workspace = true, optional = true }
thread-priority = "0.15.1"
lockfree = "0.5.1"

[dev-dependencies]
zenoh-shm = { workspace = true, features = ["test"] }
libc = { workspace = true }
16 changes: 16 additions & 0 deletions commons/zenoh-shm/src/api/client/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Copyright (c) 2023 ZettaScale Technology
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
//
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//

pub mod shared_memory_client;
pub mod shared_memory_segment;
29 changes: 29 additions & 0 deletions commons/zenoh-shm/src/api/client/shared_memory_client.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// Copyright (c) 2023 ZettaScale Technology
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
//
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//

use std::fmt::Debug;

use std::sync::Arc;

use zenoh_result::ZResult;

use crate::api::common::types::SegmentID;

use super::shared_memory_segment::SharedMemorySegment;

// SharedMemoryClient - client factory implementation for particular shared memory protocol
pub trait SharedMemoryClient: Debug + Send + Sync {
// Attach to particular shared memory segment
fn attach(&self, segment: SegmentID) -> ZResult<Arc<dyn SharedMemorySegment>>;
}
Loading