Getting data for SSE from external HTTP request #834
danechitoaie
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to implement the SSE example from here https://github.com/poem-web/poem/blob/master/examples/poem/sse/src/main.rs#L30-L37
The problem is that I need to get the data from some external API that then I need to postprocess a bit and then return the chunks of data as SSE.
I've also seen a similar question here #446
Would the answer provided by @sunli829 to use
mpsc::unbounded_channel();
andtokio::spawn(async move {
be the solution for my use case as well? And make the needed external HTTP requests inside thetokio::spawn(async move {
block?Thanks.
Beta Was this translation helpful? Give feedback.
All reactions