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
{{ message }}
Repository navigation
Postpone side effect on Fanout cache instantiation #379
Currently, the FanoutCache init method invokes mkdtemp, which creates the directory as a side effect.
In a module that defines FanoutCache() at the module level to then use it with decorator memoize, importing this module will perform the temporary directory creation as a side effect on import, something that can be a problem in some contexts (e.g. testing)
The request would be to delay directory creation and shard definition until the first use of the caching or any other directory needing method or property, and only then create the directory, so that module import would not perform the side effect. This can be optional (e.g with a flag on constructor)
Activity