Skip to content

Commit 66e49d4

Browse files
authored
A couple of errata for the README regarding external storage (#1424)
1 parent 0135935 commit 66e49d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,15 +578,15 @@ class MyDriver(StorageDriver):
578578
claims = []
579579
for payload in payloads:
580580
key = await my_storage.put(payload.SerializeToString())
581-
claims.append(StorageDriverClaim(data={"key": key}))
581+
claims.append(StorageDriverClaim(claim_data={"key": key}))
582582
return claims
583583

584584
async def retrieve(
585585
self, context: StorageDriverRetrieveContext, claims: Sequence[StorageDriverClaim]
586586
) -> list[Payload]:
587587
payloads = []
588588
for claim in claims:
589-
data = await my_storage.get(claim.data["key"])
589+
data = await my_storage.get(claim.claim_data["key"])
590590
p = Payload()
591591
p.ParseFromString(data)
592592
payloads.append(p)
@@ -597,7 +597,7 @@ Some things to note about implementing a custom driver:
597597

598598
* `StorageDriver.name()` must return a string that is unique among all drivers in `ExternalStorage.drivers`. This name is embedded in the reference payload stored in workflow history and used to look up the correct driver during retrieval — changing it after payloads have been stored will break retrieval.
599599
* `StorageDriver.type()` is automatically implemented to return the name of the class. This can be overridden in subclasses but must remain consistent across all instances of the subclass.
600-
* Implement `temporalio.converter.WithSerializationContext` on your driver to receive workflow or activity context (namespace, workflow ID, activity ID, etc.) at serialization time.
600+
* Use `StorageDriverStoreContext.target` inside `store()` when you need workflow or activity identity (namespace, workflow ID, activity ID, etc.) to choose where or how to store payloads.
601601

602602
### Workers
603603

0 commit comments

Comments
 (0)