Skip to content

fastapi-react : error on streaming (unhandled errors in a TaskGroup there is no current event loop in thread AnyIO worker thread) #5

@ghost

Description

When using the code fastapi-react for the tutorial, I couldn't run the streaming message part because of the following error:
unhandled errors in a TaskGroup there is no current event loop in thread AnyIO worker thread

After checking the documentation I've discovered that the event_stream_generator function in backend/src/api/main.py should be

async def event_stream_generator(workflowRunId):
    ''' This helper function is a generator that yields events from the Hatchet event stream. '''
    listener = hatchet.client.listener.stream(workflowRunId)
    async for event in listener:
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions