pulsar.cache package
Submodules
pulsar.cache.persistence module
pulsar.cache.util module
- class pulsar.cache.util.Time[source]
Bases:
objectTime utilities of now that can be instrumented for testing.
- pulsar.cache.util.atomicish_move(source, destination, tmp_suffix='_TMP')[source]
Move source to destination without risk of partial moves.
> from tempfile import mkdtemp > from os.path import join, exists > temp_dir = mkdtemp() > source = join(temp_dir, “the_source”) > destination = join(temp_dir, “the_dest”) > open(source, “wb”).write(b”Hello World!”) > assert exists(source) > assert not exists(destination) > atomicish_move(source, destination) > assert not exists(source) > assert exists(destination)
Module contents
- class pulsar.cache.Cache(cache_directory='file_cache')[source]
Bases:
PersistenceStoreMaintain a cache of uploaded files.