You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@yarikoptic The naïve way to implement this would be to just wrap the generator output in a list, but that would not work for our use case, as then the digester would block before returning the progress information all at once. Other than that, I don't see how this would be implemented without being able to directly query & modify the cache.
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.
The text was updated successfully, but these errors were encountered: