[QUESTION] Delivering real time JSON packages to clients on events
See original GitHub issueFirst check
- I used the GitHub search to find a similar issue and didn’t find it.
- I searched the FastAPI documentation, with the integrated search.
- I already searched in Google “How to X in FastAPI” and didn’t find any information.
Description
I have to deliver JSON packages to clients when specific events happens. I imagine building a FastAPI application where people can subscribe and add some callback. Is this the industry-standard of doing things (and is this the right place to look)? I imagine some /subscribe
POST with callback instructions and /unsubscribe
.
Alternatively I could require people to set up some kind of server to receive the data of course and then HTTP POST e.g.
If this question is out of scope here then please let me know and just close the question. Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
JSON Event - Qualtrics
First, you will need to create a workflow. · Make sure you're in the Your workflows tab. · Click Create a workflow. ·...
Read more >Real-time push and events — Zulip 7.0-dev+git documentation
Zulip's event delivery system is based on “long-polling”; basically clients make GET /json/events calls to the server, and the server doesn't respond to...
Read more >Use incoming webhooks to get real-time updates - Stripe
A webhook enables Stripe to push real-time notifications to your app. Stripe uses HTTPS to send these notifications to your app as a...
Read more >Adobe I/O Events Frequently Asked Questions (FAQ)
What is the guarantee of events delivery? ... Adobe I/O Events provides durable delivery. It delivers each event at least once for each...
Read more >API Reference | Eventbrite Platform
Eventbrite brings people together through live experiences. Discover events that match your passions, or create your own with online ticketing tools.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mr-bjerre a common pattern (and then one I’ve followed in a few places) is to use the web sockets for very basic information only. Not sure how your schema is set up, but let’s say each new piece of news has some unique ID that users can use to pull from a normal FastAPI endpoint. You could, on publish, push just that new ID to clients via websocket. Then, the client could fetch the full details (with all the glory of the OpenAPI schema) with a normal HTTP call.
I’ve only used SocketIO, which utilizes websockets but also allows for long polling for older clients. It has some additional features that make sending/receiving events easy.
One other thing you might consider is using GraphQL instead of REST. GraphQL has a concept of subscriptions I believe (though I’ve never actually used them) and is supported fairly well on Starlette.
Either way I don’t think FastAPI itself will solve your real time problem
Ha sorry I don’t know why I thought he answered.
Thank you retnikt! 🙏