class S3StorageDriver(StorageDriver): (source)
Constructor: S3StorageDriver(client, bucket, driver_name, max_payload_size)
Driver for storing and retrieving Temporal payloads in Amazon S3.
Requires an S3StorageDriverClient and a bucket. Payloads are keyed by
a SHA-256 hash of their serialized bytes, segmented by namespace and
workflow/activity identifiers derived from the serialization context.
Warning
This API is experimental.
| Method | __init__ |
Constructs the S3 driver. |
| Method | name |
Return the driver instance name. |
| Async Method | retrieve |
Retrieves payloads from S3 for the given temporalio.extstore.DriverClaim list. |
| Async Method | store |
Stores payloads in S3 and returns a temporalio.extstore.DriverClaim for each one. |
| Method | type |
Return the driver type identifier. |
| Method | _get |
Resolve bucket using the configured strategy. |
| Instance Variable | _bucket |
Undocumented |
| Instance Variable | _client |
Undocumented |
| Instance Variable | _driver |
Undocumented |
| Instance Variable | _max |
Undocumented |
S3StorageDriverClient, bucket: str | Callable[ [ StorageDriverStoreContext, Payload], str], driver_name: str = 'aws.s3driver', max_payload_size: int = 50 * 1024 * 1024):
(source)
¶
Constructs the S3 driver.
| Parameters | |
client:S3StorageDriverClient | An S3StorageDriverClient implementation. Use
temporalio.contrib.aws.s3driver.aioboto3.new_aioboto3_client to
wrap an aioboto3 S3 client. |
bucket:str | Callable[ | S3 bucket name, access point ARN, or a callable that accepts (StorageDriverStoreContext, Payload) and returns a bucket name. A callable allows dynamic per-payload bucket selection. |
driverstr | Name of this driver instance. Defaults to "aws.s3driver". Override when registering multiple S3StorageDriver instances with distinct configurations under the same temporalio.extstore.Options.drivers list. |
maxint | Maximum serialized payload size in bytes that the driver will accept. Defaults to 52428800 (50 MiB). Raise this value if your workload requires larger payloads; lower it to enforce stricter limits. |
StorageDriverRetrieveContext, claims: Sequence[ StorageDriverClaim]) -> list[ Payload]:
(source)
¶
Retrieves payloads from S3 for the given temporalio.extstore.DriverClaim list.
StorageDriverStoreContext, payloads: Sequence[ Payload]) -> list[ StorageDriverClaim]:
(source)
¶
temporalio.converter.StorageDriver.storeStores payloads in S3 and returns a temporalio.extstore.DriverClaim for each one.
Payloads are keyed by their SHA-256 hash, so identical serialized bytes share the same S3 object. Deduplication is best-effort because the same Python value may serialize differently across payload converter versions (e.g. proto binary). The returned list is the same length as payloads.
Object keys exceeding 1,024 bytes fall back to a namespace-scoped hash key. Empty namespaces on workflow and activity targets use "null".