Skip to content

how to live-update on-demand instead of via a file watcher? #48

@timotheecour

Description

@timotheecour

@breuleux , I want to be able to explicitly control when live-update happens, as opposed to doing live-update when a file watcher triggers, eg:

while True:
  if check_for_change():
    jurigged.live_update(file_pattern)
  run_loop_body()

check_for_change could itself use a file watcher or any user defined logic.
jurigged.live_update(file_pattern) would then live-update code filtered by file_pattern.

This would allow users to specify when it's safe to update code (eg to avoid race conditions), or allow editing + saving multiple files atomically without triggering a reload until all the desired changes are made (whereas with current file watchers, you'd lose atomicity)

How can I achieve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions