Skip to content

Commit 8038a08

Browse files
authored
Merge pull request #39 from yoshuawuyts/pch/fixups_for_draft2
Minor fixes, and release 0.5.0-draft2
2 parents 922dfcf + e9549d7 commit 8038a08

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ members = [
3434
resolver = "2"
3535

3636
[workspace.package]
37-
version = "0.5.0-draft1"
37+
version = "0.5.0-draft2"
3838
edition = "2021"
3939
license = "MIT OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception"
4040
repository = "https://github.com/yoshuawuyts/wstd"
@@ -65,4 +65,4 @@ wasmtime = "26"
6565
wasmtime-wasi = "26"
6666
wasmtime-wasi-http = "26"
6767
wstd = { path = "." }
68-
wstd-macro = { path = "macro", version = "=0.5.0-draft1" }
68+
wstd-macro = { path = "macro", version = "=0.5.0-draft2" }

src/http/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::{response::IncomingBody, Body, Error, Request, Response, Result};
2-
use crate::io::{self, AsyncOutputStream};
3-
use crate::runtime::Reactor;
2+
use crate::io::{self, AsyncOutputStream, AsyncPollable};
43
use crate::time::Duration;
54
use wasi::http::types::{OutgoingBody, RequestOptions as WasiRequestOptions};
65

@@ -34,7 +33,8 @@ impl Client {
3433
OutgoingBody::finish(wasi_body, trailers).unwrap();
3534

3635
// 4. Receive the response
37-
Reactor::current().wait_for(res.subscribe()).await;
36+
AsyncPollable::new(res.subscribe()).wait_for().await;
37+
3838
// NOTE: the first `unwrap` is to ensure readiness, the second `unwrap`
3939
// is to trap if we try and get the response more than once. The final
4040
// `?` is to raise the actual error if there is one.

src/runtime/reactor.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,6 @@ impl Reactor {
207207
}
208208
ready
209209
}
210-
211-
/// Wait for the pollable to resolve.
212-
pub async fn wait_for(&self, pollable: Pollable) {
213-
let p = self.schedule(pollable);
214-
p.wait_for().await
215-
}
216210
}
217211

218212
#[cfg(test)]

0 commit comments

Comments
 (0)