mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2025-12-31 21:59:49 -06:00
* feat: streaming examples + gen * feat: more examples * chore: gen again * feat: fastapi example * chore: gen * feat: callout * fix: typos * fix: whoops - how did this work? Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
18 lines
448 B
Python
18 lines
448 B
Python
import asyncio
|
|
|
|
from examples.streaming.worker import stream_task
|
|
from hatchet_sdk.clients.listeners.run_event_listener import StepRunEventType
|
|
|
|
|
|
async def main() -> None:
|
|
# > Consume
|
|
ref = await stream_task.aio_run_no_wait()
|
|
|
|
async for chunk in ref.stream():
|
|
if chunk.type == StepRunEventType.STEP_RUN_EVENT_TYPE_STREAM:
|
|
print(chunk.payload, flush=True, end="")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|