This means that there can be a large interval-length delay between the time the runner completes and the time that the last write is made by start_periodic_saving.
This is very confusing when you wait for the runner to finish with await runner.task and the results are not yet written.
Fix is to have the await await both the timeout and runner.task (remembering to shield runner.task)
The current implementation of 'start_periodic_saving' does
await sleep(interval)
:https://github.com/python-adaptive/adaptive/blob/88f02588cf66d0276b9b77da466aa71c7c1f1773/adaptive/runner.py#L839C1-L843C50
This means that there can be a large
interval
-length delay between the time the runner completes and the time that the last write is made bystart_periodic_saving
.This is very confusing when you wait for the runner to finish with
await runner.task
and the results are not yet written.Fix is to have the
await
await both the timeout andrunner.task
(remembering to shieldrunner.task
)