mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-06 16:59:39 -06:00
[Python] Fix: Misc. Python Bugs (#1451)
* fix: stop trying to parse payloads back from json
* feat: streaming example
* feat: aio output
* fix: lint
* feat: sync and async examples
* fix: small issues
* fix: one more small thing
* chore: version
* fix: lint
* fix: add sleeps
* feat: factor out run_async_from_sync
* Revert "feat: factor out run_async_from_sync"
This reverts commit fb37395913.
* fix: schedule trigger namespace issue
* fix: log error if action payload fails to decode but don't raise out of listener
This commit is contained in:
19
sdks/python/examples/streaming/async_stream.py
Normal file
19
sdks/python/examples/streaming/async_stream.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import asyncio
|
||||
|
||||
from examples.streaming.worker import streaming_workflow
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
ref = await streaming_workflow.aio_run_no_wait()
|
||||
await asyncio.sleep(1)
|
||||
|
||||
stream = ref.stream()
|
||||
|
||||
async for chunk in stream:
|
||||
print(chunk)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user