con / con/fscacher

support generator functions

Open
#37 1 comment 0 reactions 1 assignee Assigned to @yarikoptic-gitmate View on GitHub
Dominant language
Python
Stars
2
Forks
2
PR merge metrics
No merged PRs in 30d

Description

the simplest implementation would be to detect if a function to be wrapped is producing a generator function (`inspect.isgeneratorfunction`), and thus fscacher would cache all yielded results and wrapped function would also be a generator possibly just re-yielding them from the cache.

use case which inspired it -- caching of hash computation which would yield progress status while computing it: https://github.com/dandi/dandi-cli/issues/400 . But I think, although could be used, in this case we need some different construct since we would not be interested in all the progress indicators if value is cached. So, although inspired by the use case, and could be used, it would be not a complete optimal solution for it.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.