rename reader_task
This commit is contained in:
parent
f275069f23
commit
dbf9e8cdac
@ -58,7 +58,7 @@ struct Cli {
|
|||||||
measure: bool,
|
measure: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn reader_task(tx: mpsc::Sender<Question>) {
|
fn zip_reader_task(tx: mpsc::Sender<Question>) {
|
||||||
let zip_file = fs::File::open(ZIP_FILENAME).unwrap();
|
let zip_file = fs::File::open(ZIP_FILENAME).unwrap();
|
||||||
let zip_reader = io::BufReader::new(zip_file);
|
let zip_reader = io::BufReader::new(zip_file);
|
||||||
let archive = zip::ZipArchive::new(zip_reader).unwrap();
|
let archive = zip::ZipArchive::new(zip_reader).unwrap();
|
||||||
@ -124,7 +124,7 @@ fn db_writer_task(rx: mpsc::Receiver<Question>) {
|
|||||||
fn write_db() {
|
fn write_db() {
|
||||||
let (tx, rx) = mpsc::channel::<Question>();
|
let (tx, rx) = mpsc::channel::<Question>();
|
||||||
[
|
[
|
||||||
thread::spawn(move || reader_task(tx)),
|
thread::spawn(move || zip_reader_task(tx)),
|
||||||
thread::spawn(move || db_writer_task(rx)),
|
thread::spawn(move || db_writer_task(rx)),
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@ -258,7 +258,7 @@ fn read_from_db2(id: u32) -> Option<Question> {
|
|||||||
fn write_db2() {
|
fn write_db2() {
|
||||||
let (tx, rx) = mpsc::channel::<Question>();
|
let (tx, rx) = mpsc::channel::<Question>();
|
||||||
[
|
[
|
||||||
thread::spawn(move || reader_task(tx)),
|
thread::spawn(move || zip_reader_task(tx)),
|
||||||
thread::spawn(move || db_writer2_task(rx)),
|
thread::spawn(move || db_writer2_task(rx)),
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
Loading…
Reference in New Issue
Block a user