Skip to content

Commit

Permalink
bgzf/multithreaded_reader: Add virtual position getter
Browse files Browse the repository at this point in the history
  • Loading branch information
zaeleus committed Aug 29, 2023
1 parent 5bfd362 commit 7dfd82f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion noodles-bgzf/src/multithreaded_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{

use crossbeam_channel::{Receiver, Sender};

use crate::Block;
use crate::{Block, VirtualPosition};

type BufferedTx = Sender<io::Result<Buffer>>;
type BufferedRx = Receiver<io::Result<Buffer>>;
Expand Down Expand Up @@ -71,6 +71,11 @@ impl MultithreadedReader {
self.position
}

/// Returns the current virtual position of the stream.
pub fn virtual_position(&self) -> VirtualPosition {
self.buffer.block.virtual_position()
}

/// Shuts down the reader and inflate workers.
pub fn finish(&mut self) -> io::Result<()> {
self.recycle_tx.take();
Expand Down

0 comments on commit 7dfd82f

Please sign in to comment.