Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions samples/durable-task-sdks/python/large-payload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Result: "Processed 10000 records (70000 bytes)"
Done!
```

Both orchestrations produce the same type of result. The difference is invisible to the application code — the SDK transparently externalizes the 70 KB payload to blob storage and retrieves it when needed.
Both orchestrations produce the same type of result. The difference is invisible to the application code — the SDK transparently externalizes the ~342 KB payload to blob storage and retrieves it when needed.

## Code Walkthrough

Expand All @@ -179,13 +179,13 @@ The `BlobPayloadStore` is configured with a `BlobPayloadStoreOptions` object:
```python
store = BlobPayloadStore(BlobPayloadStoreOptions(
connection_string=storage_conn_str,
threshold_bytes=1_024, # Externalize payloads larger than 1 KB
threshold_bytes=262_144, # Externalize payloads larger than 256 KiB
))
```

Key options:
- **`connection_string`**: Azure Storage connection string (or `UseDevelopmentStorage=true` for Azurite)
- **`threshold_bytes`**: Payloads larger than this are externalized (default: 900 KB)
- **`threshold_bytes`**: Payloads larger than this are externalized (default: 256 KiB)
- **`max_stored_payload_bytes`**: Maximum payload size that can be stored (default: 10 MB)
- **`enable_compression`**: Whether to compress payloads with GZip before storing (default: `True`)
- **`container_name`**: Blob container name (default: `durabletask-payloads`)
Expand Down
4 changes: 2 additions & 2 deletions samples/durable-task-sdks/python/large-payload/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def main():
# Configure the blob payload store — must match the worker configuration
store = BlobPayloadStore(BlobPayloadStoreOptions(
connection_string=storage_conn_str,
threshold_bytes=1_024,
threshold_bytes=262_144,
))

# Set credential to None for emulator, or DefaultAzureCredential for Azure
Expand Down Expand Up @@ -61,7 +61,7 @@ async def main():
# --- Large payload (externalized to blob storage) ---
print("\n--- Large payload (externalized to blob storage) ---")
instance_id = client.schedule_new_orchestration(
"large_payload_orchestrator", input=10_000
"large_payload_orchestrator", input=50_000
)
logger.info(f"Scheduled orchestration with ID: {instance_id}")

Expand Down
6 changes: 3 additions & 3 deletions samples/durable-task-sdks/python/large-payload/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ async def main():
print(f"Using taskhub: {taskhub_name}")
print(f"Using endpoint: {endpoint}")

# Configure the blob payload store with a low threshold for demo purposes
# Configure the blob payload store (256 KiB threshold, matching the SDK default)
store = BlobPayloadStore(BlobPayloadStoreOptions(
connection_string=storage_conn_str,
# Use a low threshold so that externalization is visible in the demo
threshold_bytes=1_024,
# 256 KiB, matching the SDK default; larger payloads are externalized
threshold_bytes=262_144,
))

# Set credential to None for emulator, or DefaultAzureCredential for Azure
Expand Down
Loading