feat (py-sdk): python streaming generator (#154)

* hotfix: add repository for npm publish

* release(py-sdk): bump version

* feat: expose generator

* release: bump version
This commit is contained in:
Gabe Ruttner
2024-02-05 18:16:23 -05:00
committed by GitHub
parent 38d93ec1f1
commit 5f06e8cfce
4 changed files with 26 additions and 3 deletions
@@ -0,0 +1,16 @@
from hatchet_sdk import Hatchet
from dotenv import load_dotenv
import json
load_dotenv()
client = Hatchet().client
workflowRunId = client.admin.run_workflow("ManualTriggerWorkflow", {
"test": "test"
})
for event in client.listener.generator(workflowRunId):
print('EVENT: ' + event.type + ' ' + json.dumps(event.payload))
# TODO - need to hangup the listener if the workflow is completed