Skip to content

Commit

Permalink
addressed comments
Browse files Browse the repository at this point in the history
Signed-off-by: shubham <[email protected]>
  • Loading branch information
shubhamdixit863 committed May 30, 2024
1 parent 108c2ef commit e0350fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions examples/simple-source/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ pub(crate) mod simple_source {
self.read_idx
.store(self.read_idx.load(Ordering::Relaxed) + 1, Ordering::Relaxed);
let offset = self.read_idx.load(Ordering::Relaxed);
let mut headers = HashMap::new();
let header_key=String::from(Uuid::new_v4());
let header_value= String::from("numaflow");
headers.insert(header_key, header_value);
headers.insert(String::from("x-txn-id"), String::from(Uuid::new_v4()));
let shared_headers = Arc::new(headers);
// send the message to the transmitter
transmitter
Expand Down
10 changes: 5 additions & 5 deletions src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ mod tests {
async fn read(&self, request: SourceReadRequest, transmitter: Sender<Message>) {
let event_time = Utc::now();
let mut message_offsets = Vec::with_capacity(request.count);
let mut headers = HashMap::new();
let header_key=String::from(Uuid::new_v4());
let header_value = String::from("numaflow");
headers.insert(header_key, header_value);
let shared_headers = Arc::new(headers);


for i in 0..request.count {
let mut headers = HashMap::new();
headers.insert(String::from("x-txn-id"), String::from(Uuid::new_v4()));
let shared_headers = Arc::new(headers);
// we assume timestamp in nanoseconds would be unique on each read operation from our source
let offset = format!("{}-{}", event_time.timestamp_nanos_opt().unwrap(), i);
transmitter
Expand Down

0 comments on commit e0350fb

Please sign in to comment.