Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
58 changes: 29 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ maintenance = { status = "actively-developed" }
[dependencies]
paste = "1.0.14"
pyo3 = { version = "0.25.1", features = ["abi3-py39", "extension-module"] }
zenoh = { version = "1.9.0", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = [
zenoh = { version = "1.9.0", git = "https://github.com/zettascalelabs/zenoh.git", branch = "feat/routing-timestamps", features = [
"internal",
"unstable",
], default-features = false }
zenoh-ext = { version = "1.9.0", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = [
zenoh-ext = { version = "1.9.0", git = "https://github.com/zettascalelabs/zenoh.git", branch = "feat/routing-timestamps", features = [
"internal",
], optional = true }
25 changes: 21 additions & 4 deletions src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::{
sample::{Locality, Sample},
session::{EntityGlobalId, Session},
time::Timestamp,
timestamp_stack::TimestampInstrumentation,
utils::{duration, generic, wait, MapInto},
ZDeserializeError,
};
Expand Down Expand Up @@ -492,30 +493,46 @@ impl AdvancedPublisher {
Ok(self.get_ref()?.priority().into())
}

#[pyo3(signature = (payload, *, encoding = None, attachment = None, timestamp = None))]
#[pyo3(signature = (payload, *, encoding = None, attachment = None, timestamp = None, timestamp_instrumentation = None))]
fn put(
&self,
py: Python,
#[pyo3(from_py_with = ZBytes::from_py)] payload: ZBytes,
#[pyo3(from_py_with = Encoding::from_py_opt)] encoding: Option<Encoding>,
#[pyo3(from_py_with = ZBytes::from_py_opt)] attachment: Option<ZBytes>,
timestamp: Option<Timestamp>,
timestamp_instrumentation: Option<TimestampInstrumentation>,
) -> PyResult<()> {
let this = self.get_ref()?;
wait(
py,
build!(this.put(payload), encoding, attachment, timestamp),
build!(
this.put(payload),
encoding,
attachment,
timestamp,
timestamp_instrumentation
),
)
}

#[pyo3(signature = (*, attachment = None, timestamp = None))]
#[pyo3(signature = (*, attachment = None, timestamp = None, timestamp_instrumentation = None))]
fn delete(
&self,
py: Python,
#[pyo3(from_py_with = ZBytes::from_py_opt)] attachment: Option<ZBytes>,
timestamp: Option<Timestamp>,
timestamp_instrumentation: Option<TimestampInstrumentation>,
) -> PyResult<()> {
wait(py, build!(self.get_ref()?.delete(), attachment, timestamp))
wait(
py,
build!(
self.get_ref()?.delete(),
attachment,
timestamp,
timestamp_instrumentation
),
)
}

fn undeclare(&mut self, py: Python) -> PyResult<()> {
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mod session;
#[cfg(feature = "shared-memory")]
mod shm;
mod time;
mod timestamp_stack;
mod utils;

use pyo3::prelude::*;
Expand Down Expand Up @@ -77,6 +78,10 @@ pub(crate) mod zenoh {
Transport, TransportEvent, TransportEventsListener,
},
time::{Timestamp, TimestampId, NTP64},
timestamp_stack::{
InterceptionPoint, TimestampInstrumentation, TimestampInstrumentationBuilder,
TimestampStack, TimestampStackRecord, TsStackContext,
},
ZError,
};

Expand Down
Loading
Loading