I would like to save data to a file every second. The data records is simple, just a date and number, and would like to append to the file. This can last the whole day, so the file can end up being big.
I do not want to block the main thread, nor have concurrency issues. It also has to be capable to being written to in the background, as opposed to the app being in the foreground.
What's the best way forward to achieve this?