Fix: Python docs examples (#2255)

* feat: client example

* fix: batch i

* fix: batch ii

* fix: batch iii

* fix: batch iv
This commit is contained in:
matt
2025-09-05 15:08:23 -04:00
committed by GitHub
parent 8c85f47cd8
commit 4a50e454a6
46 changed files with 404 additions and 275 deletions

View File

@@ -1,6 +1,27 @@
from hatchet_sdk import Hatchet
from hatchet_sdk import Hatchet, PushEventOptions
from hatchet_sdk.clients.events import BulkPushEventWithMetadata
hatchet = Hatchet()
# > Event trigger
hatchet.event.push("user:create", {"should_skip": False})
# > Event trigger with metadata
hatchet.event.push(
"user:create",
{"userId": "1234", "should_skip": False},
options=PushEventOptions(
additional_metadata={"source": "api"} # Arbitrary key-value pair
),
)
# > Bulk event push
hatchet.event.bulk_push(
events=[
BulkPushEventWithMetadata(
key="user:create",
payload={"userId": str(i), "should_skip": False},
)
for i in range(10)
]
)