You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by ri...@apache.org on 2026/08/16 08:03:26 UTC
(iggy) 02/07: add stream getters and docs
This is an automated email from the ASF dual-hosted git repository.
slbotbm pushed a commit to branch feat/add-python-stream-management-functions
in repository https://gitbox.apache.org/repos/asf/iggy.git
commit b9107f6153f423adefbbb620afa9ad2063f389e0
Author: Rimuksh Kansal <ni...@gmail.com>
AuthorDate: Tue Aug 4 17:09:16 2026 +0900
add stream getters and docs
---
foreign/python/src/stream.rs | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/foreign/python/src/stream.rs b/foreign/python/src/stream.rs
index c4c7f5846..2a7055b2d 100644
--- a/foreign/python/src/stream.rs
+++ b/foreign/python/src/stream.rs
@@ -57,6 +57,10 @@ impl StreamDetails {
}
}
+/// Summary information returned by `IggyClient.get_streams()`.
+///
+/// `created_at` is Unix time in microseconds. `size_bytes` is the stream's
+/// current stored size in bytes.
#[gen_stub_pyclass]
#[pyclass]
pub struct Stream {
@@ -72,21 +76,37 @@ impl From<RustStream> for Stream {
#[gen_stub_pymethods]
#[pymethods]
impl Stream {
+ /// Numeric stream identifier.
#[getter]
pub fn id(&self) -> u32 {
self.inner.id
}
+ /// Stream creation time as Unix time in microseconds.
+ #[getter]
+ pub fn created_at(&self) -> u64 {
+ self.inner.created_at.as_micros()
+ }
+
+ /// Unique stream name.
#[getter]
pub fn name(&self) -> String {
self.inner.name.to_string()
}
+ /// Current stored stream size in bytes.
+ #[getter]
+ pub fn size_bytes(&self) -> u64 {
+ self.inner.size.as_bytes_u64()
+ }
+
+ /// Total messages across all topics in the stream.
#[getter]
pub fn messages_count(&self) -> u64 {
self.inner.messages_count
}
+ /// Number of topics in the stream.
#[getter]
pub fn topics_count(&self) -> u32 {
self.inner.topics_count