class ExternalStorage(WithSerializationContext): (source)
Configuration for external storage behavior.
Warning
This API is experimental.
| Method | __post |
Validate drivers and build the internal name-keyed driver map. |
| Method | with |
Return a copy of these options with the serialization context applied. |
| Class Variable | driver |
Controls which driver stores a given payload. A callable that returns the driver instance to use, or None to leave the payload stored inline. The returned driver must be one of the instances registered in ... |
| Class Variable | drivers |
Drivers available for storing and retrieving payloads. At least one driver must be provided. If more than one driver is registered, driver_selector must also be set. |
| Class Variable | payload |
Minimum payload size in bytes before external storage is considered. Defaults to 256 KiB. Set to None to consider every payload for external storage regardless of size. |
| Method | _get |
Looks up a driver by name, raising ValueError if not found. |
| Async Method | _retrieve |
Undocumented |
| Async Method | _retrieve |
Undocumented |
| Async Method | _retrieve |
Undocumented |
| Method | _select |
Returns the driver to use for this payload, or None to pass through. |
| Async Method | _store |
Undocumented |
| Async Method | _store |
Undocumented |
| Async Method | _store |
Undocumented |
| Method | _validate |
Undocumented |
| Method | _validate |
Undocumented |
| Class Variable | _claim |
Undocumented |
| Class Variable | _context |
Undocumented |
| Class Variable | _driver |
Name-keyed index of drivers, built at construction time. Used for retrieval lookups. |
Validate drivers and build the internal name-keyed driver map.
Raises ValueError if no drivers are provided, if more than one
driver is registered without a driver_selector, or if any two
drivers share the same name.
Callable[ [ StorageDriverStoreContext, Payload], StorageDriver | None] | None =
(source)
¶
Controls which driver stores a given payload. A callable that returns the
driver instance to use, or None to leave the payload stored inline.
The returned driver must be one of the instances registered in
drivers.
Required when more than one driver is registered. When None and only one driver is registered, that driver is used for all store operations.
Drivers available for storing and retrieving payloads. At least one
driver must be provided. If more than one driver is registered,
driver_selector must also be set.
Drivers in this list are looked up by StorageDriver.name during
retrieval, so each driver must have a unique name.
Minimum payload size in bytes before external storage is considered. Defaults to 256 KiB. Set to None to consider every payload for external storage regardless of size.
Sequence[ Payload]) -> list[ Payload]:
(source)
¶
Undocumented
StorageDriverStoreContext, payload: Payload) -> StorageDriver | None:
(source)
¶
Returns the driver to use for this payload, or None to pass through.
Sequence[ StorageDriverClaim], expected: int, driver: StorageDriver):
(source)
¶
Undocumented
Sequence[ Payload], expected: int, driver: StorageDriver):
(source)
¶
Undocumented