fleche.storage.pickle_file
Attributes
Classes
Store values as files on the filesystem using a serialization module. |
|
Mixin that locks per-key so concurrent ops on different keys proceed in parallel. |
|
Mixin that locks per-key so concurrent ops on different keys proceed in parallel. |
Module Contents
- class fleche.storage.pickle_file.PickleFileBackend[source]
Bases:
fleche.storage.file.FileStorageStore values as files on the filesystem using a serialization module.
- classmethod with_pickle(*args, **kwargs)[source]
Construct a PickleFileBackend using the standard pickle module.
- classmethod with_cloudpickle(*args, **kwargs)[source]
Construct a PickleFileBackend using the cloudpickle module.
- class fleche.storage.pickle_file.ValuePickleFile[source]
Bases:
fleche.storage.thread_safe.PerKeyLockMixin,fleche.storage.destructuring.DestructuringMixin,fleche.storage.base.ValueMixin,PickleFileBackendMixin that locks per-key so concurrent ops on different keys proceed in parallel.
A lightweight
threading.Lockguards the lock-table itself; once the per-keyRLockis obtained the table lock is released, so two threads operating on different keys never block each other. Operations on the same key are serialized by the per-key lock, which is reentrant to allow nested calls (e.g.expandinsideload).Instances must be hashable. Place before the concrete storage class in the MRO:
@dataclass(frozen=True) class PerKeyValuePickle(PerKeyLockMixin, ValuePickleFile): ...
- class fleche.storage.pickle_file.CallPickleFile[source]
Bases:
fleche.storage.thread_safe.PerKeyLockMixin,fleche.storage.base.CallMixin,PickleFileBackendMixin that locks per-key so concurrent ops on different keys proceed in parallel.
A lightweight
threading.Lockguards the lock-table itself; once the per-keyRLockis obtained the table lock is released, so two threads operating on different keys never block each other. Operations on the same key are serialized by the per-key lock, which is reentrant to allow nested calls (e.g.expandinsideload).Instances must be hashable. Place before the concrete storage class in the MRO:
@dataclass(frozen=True) class PerKeyValuePickle(PerKeyLockMixin, ValuePickleFile): ...