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

Update futures-preview to 0.3.0-alpha.16 #18

Merged
merged 2 commits into from
May 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ license = "MIT OR Apache-2.0"

[dependencies]
crossbeam = "0.6.0"
futures-preview = "0.3.0-alpha.15"
futures-preview = "0.3.0-alpha.16"
num_cpus = "1.9.0"
lazy_static = "1.2.0"

[dev-dependencies]
romio = "0.3.0-alpha.6"
romio = "0.3.0-alpha.7"
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ configuration. It exposes the most minimal API possible.

## Example
```rust
#![feature(async_await, await_macro)]
#![feature(async_await)]

use std::io;

Expand All @@ -29,14 +29,14 @@ fn main() -> io::Result<()> {

println!("Listening on 127.0.0.1:7878");

while let Some(stream) = await!(incoming.next()) {
while let Some(stream) = incoming.next().await {
let stream = stream?;
let addr = stream.peer_addr()?;

juliex::spawn(async move {
println!("Accepting stream from: {}", addr);

await!(echo_on(stream)).unwrap();
echo_on(stream).await.unwrap();

println!("Closing stream from: {}", addr);
});
Expand All @@ -48,7 +48,7 @@ fn main() -> io::Result<()> {

async fn echo_on(stream: TcpStream) -> io::Result<()> {
let (mut reader, mut writer) = stream.split();
await!(reader.copy_into(&mut writer))?;
reader.copy_into(&mut writer).await?;
Ok(())
}
```
Expand Down
8 changes: 4 additions & 4 deletions examples/echo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await, await_macro)]
#![feature(async_await)]

use std::io;

Expand All @@ -15,14 +15,14 @@ fn main() -> io::Result<()> {

println!("Listening on 127.0.0.1:7878");

while let Some(stream) = await!(incoming.next()) {
while let Some(stream) = incoming.next().await {
let stream = stream?;
let addr = stream.peer_addr()?;

juliex::spawn(async move {
println!("Accepting stream from: {}", addr);

await!(echo_on(stream)).unwrap();
echo_on(stream).await.unwrap();

println!("Closing stream from: {}", addr);
});
Expand All @@ -34,6 +34,6 @@ fn main() -> io::Result<()> {

async fn echo_on(stream: TcpStream) -> io::Result<()> {
let (mut reader, mut writer) = stream.split();
await!(reader.copy_into(&mut writer))?;
reader.copy_into(&mut writer).await?;
Ok(())
}
6 changes: 3 additions & 3 deletions examples/http.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await, await_macro)]
#![feature(async_await)]

use std::io;

Expand All @@ -16,12 +16,12 @@ fn main() -> io::Result<()> {

println!("Listening on 127.0.0.1:7878");

while let Some(stream) = await!(incoming.next()) {
while let Some(stream) = incoming.next().await {
let stream = stream?;

juliex::spawn(async move {
let (_, mut writer) = stream.split();
await!(writer.write_all(b"HTTP/1.1 200 OK\r\nContent-Length:0\r\n\r\n")).unwrap();
writer.write_all(b"HTTP/1.1 200 OK\r\nContent-Length:0\r\n\r\n").await.unwrap();
});
}

Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//!
//! ## Example
//! ```rust,no_run
//! #![feature(async_await, await_macro)]
//! #![feature(async_await)]
//!
//! use std::io;
//!
Expand All @@ -29,14 +29,14 @@
//!
//! println!("Listening on 127.0.0.1:7878");
//!
//! while let Some(stream) = await!(incoming.next()) {
//! while let Some(stream) = incoming.next().await {
//! let stream = stream?;
//! let addr = stream.peer_addr()?;
//!
//! juliex::spawn(async move {
//! println!("Accepting stream from: {}", addr);
//!
//! await!(echo_on(stream)).unwrap();
//! echo_on(stream).await.unwrap();
//!
//! println!("Closing stream from: {}", addr);
//! });
Expand All @@ -48,7 +48,7 @@
//!
//! async fn echo_on(stream: TcpStream) -> io::Result<()> {
//! let (mut reader, mut writer) = stream.split();
//! await!(reader.copy_into(&mut writer))?;
//! reader.copy_into(&mut writer).await?;
//! Ok(())
//! }
//! ```
Expand Down Expand Up @@ -149,7 +149,7 @@ impl ThreadPool {
///
/// ## Example
/// ```rust,ignore
/// #![feature(async_await, await_macro)]
/// #![feature(async_await)]
/// use std::thread;
/// use futures::executor;
///
Expand Down