Skip to content
Discussion options

You must be logged in to vote

Webhooks are a fairly common approach; clients can register a URL to be called automatically on some action, but this requires them to set up a server of their own. GitHub has its own webhooks which could give you an idea of the implementation. This is what the so-called "OpenAPI callbacks" in the FastAPI docs are, but the implementation there is a little unusual I would say.

Alternatively, if you want something more real-time, you could look in to using Websockets, but FastAPI isn't really the right tool for the job in this case. Starlette (the basis of FastAPI), however, has some pretty good websocket support. Discord uses websockets for event listening.

Replies: 10 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
5 participants
Converted from issue

This discussion was converted from issue #1339 on February 28, 2023 09:53.