noodles
noodles copied to clipboard
Implement Send + Sync on key structs?
I wanted to use rayon to parallelize some of my processing, but found that I need to have the Send + Sync
traits for key structs, like a Bed record and BAM record. Is there any appetite for adding those, and/or figuring out which are safe to send and share across threads?
bed_reader.records::<6>().par_bridge()
The data containers are Send + Sync
. See the auto trait implementations for sam::alignment::Record
and bed::Record<N>
.
Looking at ParallelBridge
, the iterator is also required to be Send
. This is not possible for bed::Reader::records<N>
because it captures Self<R>
as a mutable reference. You can, however, move the reader into your own iterator to create a producer.