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

Stream completion #31

Closed
wants to merge 3 commits into from
Closed

Stream completion #31

wants to merge 3 commits into from

Conversation

moldhouse
Copy link
Contributor

No description provided.

@@ -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> {
Copy link
Contributor Author

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?

Copy link
Contributor Author

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);
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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.

@moldhouse moldhouse closed this Oct 25, 2024
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