Skip to content

Commit

Permalink
fix: Optional start_seq_num in StreamService/ReadSession (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrongmeal authored Dec 2, 2024
1 parent 0431ef4 commit 90b5716
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ enum StreamActions {
Read {
/// Starting sequence number (inclusive). If not specified, the latest record.
#[arg(short = 's', long)]
start_seq_num: u64,
start_seq_num: Option<u64>,

/// Output records to a file or stdout.
/// Use "-" to write to stdout.
Expand Down
4 changes: 2 additions & 2 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ impl StreamService {

pub async fn read_session(
&self,
start_seq_num: u64,
start_seq_num: Option<u64>,
limit_count: Option<u64>,
limit_bytes: Option<u64>,
) -> Result<Streaming<ReadOutput>, ServiceError> {
let read_session_req = ReadSessionRequest {
start_seq_num: Some(start_seq_num),
start_seq_num,
limit: match (limit_count, limit_bytes) {
(Some(count), Some(bytes)) => Some(ReadLimit { count, bytes }),
(Some(count), None) => Some(ReadLimit { count, bytes: 0 }),
Expand Down

0 comments on commit 90b5716

Please sign in to comment.