Skip to content

large delay when using start_periodic_saving  #439

@jbweston

Description

@jbweston

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 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions