[][src]Function seq_io::parallel::read_process_fastx_records

pub fn read_process_fastx_records<R, S, W, F, O, Out>(
    reader: R,
    n_workers: u32,
    queue_len: usize,
    work: W,
    func: F
) -> Result<Option<Out>, R::Err> where
    R: RecordSetReader<RecordSet = RecordSet<S>, Err = Error> + Send,
    O: Default + Send,
    S: PositionStore,
    W: Send + Sync + Fn(RefRecord<'_, S>, &mut O),
    F: FnMut(RefRecord<'_, S>, &mut O) -> Option<Out>, 

This function wraps read_process_recordsets, hiding the complexity related to record sets and allowing it to directly work on FASTX sequence records.

Apart from this, the process is similar:

  • The records are read (as part of record sets) in a background thread.
  • Then they are sent to n_workers worker threads. Work is done in the work closure supplied to this function.
  • Once ready, records an results are sent to the main thread, where they are supplied to the func closure. The order of the records may be different.