vimsheet.fetch.fetch_manager

FetchManager — coordinates background HTTP fetches per cell.

class vimsheet.fetch.fetch_manager.FetchEntry(url: 'str', interval: 'float | None', json_path: 'str', headers: 'dict' = <factory>, method: 'str' = 'GET', last_value: 'Any' = '#LOADING', status: 'str' = 'pending', timer: 'threading.Timer | None' = None, spill_cells: 'list[tuple[int, int]]'=<factory>)[source]

Bases: object

Parameters:
url: str
interval: float | None
json_path: str
headers: dict
method: str = 'GET'
last_value: Any = '#LOADING'
status: str = 'pending'
timer: Timer | None = None
spill_cells: list[tuple[int, int]]
__init__(url, interval, json_path, headers=<factory>, method='GET', last_value='#LOADING', status='pending', timer=None, spill_cells=<factory>)
Parameters:
Return type:

None

class vimsheet.fetch.fetch_manager.FetchManager(app)[source]

Bases: object

Parameters:

app (VimSheetApp)

__init__(app)[source]
Parameters:

app (VimSheetApp)

Return type:

None

get_cached(key)[source]

Return last cached value instantly (never blocks).

Parameters:

key (tuple[str, int, int])

Return type:

Any

schedule(key, url, interval, json_path, headers=None, method='GET')[source]

Register (or re-register) a fetch for key. Idempotent on matching params.

Parameters:
Return type:

None

fetch_now(key)[source]

Force an immediate re-fetch regardless of timer.

Parameters:

key (tuple[str, int, int])

Return type:

None

cancel(key)[source]

Cancel the fetch for key and clear its spill cells.

Parameters:

key (tuple[str, int, int])

Return type:

None

cancel_all()[source]

Cancel every active fetch — call on app exit.

Return type:

None

all_entries()[source]

Snapshot for :fetchlist display.

Return type:

list[tuple[tuple[str, int, int], FetchEntry]]