mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-04-23 18:49:47 -05:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user