Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of streaming + SSE + FastAPI (async) #259

Merged
merged 2 commits into from
Jul 5, 2024
Merged

Conversation

elijahbenizzy
Copy link
Contributor

@elijahbenizzy elijahbenizzy commented Jul 4, 2024

Just parking it here to build in public.

Changes

How I tested this

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@elijahbenizzy elijahbenizzy force-pushed the streaming-examples branch 5 times, most recently from b4127e7 to 41ee104 Compare July 4, 2024 21:59
@elijahbenizzy elijahbenizzy changed the title Very WIP streaming example Example of streaming + SSE + FastAPI (async) Jul 5, 2024
Action.bind() set the attribute on the function. Thus we would bind
multiple times and overwrite it. This is particularly problematic in the
function-based API for the ApplicationBuilder, which would bind actions
before creating them. This fixes it by adding a function-copy.
@elijahbenizzy elijahbenizzy force-pushed the streaming-examples branch 2 times, most recently from cd094d6 to d543d9c Compare July 5, 2024 15:29
This adds a streaming example to the API. This has a README with some
bare-bones pieces, but is meant to accompany a blog post.

We use SSEs + async + fastAPI to build an efficient application.
@elijahbenizzy elijahbenizzy marked this pull request as ready for review July 5, 2024 15:49
@elijahbenizzy elijahbenizzy merged commit bf7d5b4 into main Jul 5, 2024
12 checks passed
@elijahbenizzy elijahbenizzy deleted the streaming-examples branch July 5, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant