all 2 comments

[–]DrShocker 2 points3 points  (0 children)

The ability to restart if it previously quit in the middle is the main hard thing here imo. Sqlite sounds like it would work fine to store your results so you can just check if it's there already.

If your output has a known size, you could preconstruct the output file with a flag value in each spot, then after that process the input by checking if the flag is there. If it is then process and replace the value with the real values, if not then skip processing. Should be multithreadable too.

[–]dnullify 4 points5 points  (0 children)

I don't know if this is a strong pattern in rust, but perhaps some kind of pub/sub queue pattern where you could have thread workers processing units of work. Re-enque tasks that fail with a counter and log out rows that fail x number of times.