-
Notifications
You must be signed in to change notification settings - Fork 2
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
Stream completion #31
Conversation
@@ -118,7 +121,7 @@ impl Default for Stopping<'_> { | |||
|
|||
/// Body send to the Aleph Alpha API on the POST `/completion` Route | |||
#[derive(Serialize, Debug)] | |||
struct BodyCompletion<'a> { | |||
pub struct BodyCompletion<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this need to be public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move StreamCompletion to completion module?
src/http.rs
Outdated
let response = self.request(task, how).await?; | ||
let mut stream = response.bytes_stream(); | ||
|
||
let (tx, rx) = mpsc::channel::<Result<T::ResponseBody, Error>>(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 should be fine
let mut stream = response.bytes_stream(); | ||
|
||
let (tx, rx) = mpsc::channel::<Result<T::ResponseBody, Error>>(100); | ||
tokio::spawn(async move { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only want to return an iterator, not spawn the thread.
No description provided.