-
Notifications
You must be signed in to change notification settings - Fork 2
Open
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: dandi/dandi-cli#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.
Metadata
Metadata
Assignees
Labels
No labels