profile
viewpoint

push event95th/torrent-rs

Gurwinder Singh

commit sha 1ceddc4ef79a7978f25161b1afd0819e7ced0f68

Clean up

view details

push time in 16 hours

fork 95th/reqwest

An easy and powerful Rust HTTP Client

https://docs.rs/reqwest

fork in 2 days

pull request commentdenoland/deno

[WIP] Refactor to use new futures api

Here is a list of dependencies, and their respective statuses.

Think most of the stuff can be checked except hyper-rustls (Perhaps use hyper-tls)?

afinch7

comment created time in 3 days

issue commentrust-lang/rust

unimplemented macro doesnt compile with RPIT

@jonas-schievink The compiler shouldn't default to () for impl Foo. So doesn't that make it a bug? Also, with never type !, the trait bound !: Foo is not satisfied.

This would mean that you can't leave functions having impl trait return types unimplemented.

95th

comment created time in 3 days

delete branch 95th/h2

delete branch : async_stable

delete time in 3 days

issue openedrust-lang/rust

unimplemented macro doesnt compile with RPIT

I believe the following should compile but doesn't.

trait Foo {}

fn bar() -> impl Foo {
    unimplemented!()
}

I get the following error:

 --> src/main.rs:7:13
  |
7 | fn bar() -> impl Foo {
  |             ^^^^^^^^ the trait `Foo` is not implemented for `()`
  |
  = note: the return type of a function must have a statically known size

Could anybody confirm if this is a bug?

created time in 3 days

startedasync-rs/async-std

started time in 4 days

push event95th/torrent-rs

Gurwinder Singh

commit sha ce8227eb52c70d1a3712478ccfc7bc3c530d18bd

Set theme jekyll-theme-minimal

view details

push time in 4 days

PR opened tokio-rs/tokio

chore: two async_await feature remained

Two async_await feature left

+0 -2

0 comment

2 changed files

pr created time in 4 days

create barnch95th/tokio

branch : async_stable

created branch time in 4 days

push event95th/tokio

Carl Lerche

commit sha ce7e60e3965283328909aaef57c57e538526a880

udp: move tokio-udp into tokio-net (#1459)

view details

Carl Lerche

commit sha ba1829fd2633d5cd5cf9f8b0bc51f68a81185a3a

chore: rename ui-tests -> build-tests (#1460)

view details

Carl Lerche

commit sha 4935aae1640e668966b615ff32425d57d843bc3a

udp: remove files left over from moving tokio-udp (#1461)

view details

Carl Lerche

commit sha a83f5e4ba60c9934b75b3e47e66d516738fef395

uds: move into tokio-net (#1462)

view details

Carl Lerche

commit sha c187cd75b6c4b4b33eff61d255d74b41ecb82acf

signal: move into tokio-net (#1463)

view details

Philip Kannegaard Hayes

commit sha 9f0daad5acafdd35c1577856e01021293d10849c

sync: fix fuzz_oneshot test by using instrumented `loom::sync::Arc` (#1464) Since `tokio_sync::oneshot` makes a `CausalCell::with_mut()` mutable access in the `Inner::drop()`, we must use the instrumented `loom::sync::Arc`. Uncovered by carllerche/loom#42

view details

Carl Lerche

commit sha 88b4ec84d7f0f1653e2a9bb3231076fc18a91cb3

chore: prepare 0.2.0-alpha.2 release (#1465)

view details

Jakub Beránek

commit sha a9585f03187316c619ddc11321a2a02cbd0d702d

tokio-process: change CommandExt to a fully asynchronous Command struct (#1448) Refs: #1371

view details

Ivan Petkov

commit sha bc61bd9d3d401b8825bcfcd802ddd80a7ad2ebeb

ci: ensure all tests are run for each feature (#1470) * This includes running docs, examples, and lib tests for each added feature, to ensure nothing is broken

view details

Ivan Petkov

commit sha 6d8d388dc575896b39f5fa4134667b8ffa7f2fb7

docs: add docs.rs metadata to build with all features (#1471)

view details

Douman

commit sha 7b0c60849cefa9e73b0fec9c16da2f7dc5edb082

net: make default reactor guard public (#1468)

view details

Ivan Petkov

commit sha 08b07afbd9beb8d92c7aeb0cf07e56d065a73726

signal: remove `new()` constructors in favor of free functions (#1472) * Also removed any `*_with_handle` related methods in favor of always using the default reactor

view details

Ivan Petkov

commit sha 68d5fcb8d154309ba5abeaf8f092835ff3fa7c52

docs: fix all rustdoc warnings (#1474)

view details

John-John Tedro

commit sha 34a9dc2d764a5f413d365ed4af94f6af4c42a14a

Implement FusedStream and FusedFuture for Interval and Delay (#1476)

view details

Ivan Petkov

commit sha 357df38861ec61547b5b1d90f0007c11d53fb9ec

process: move into the tokio-net crate (#1475)

view details

Jakub Beránek

commit sha 2d56312b89ba407272b161290d563551efc896a6

timer: introduce delay function shortcut (#1440) This commit adds a simple delay shortcut to avoid writing Delay::new everywhere and removes usages of Delay::new.

view details

Eliza Weisman

commit sha 7e7a5147a3f5de83ee540ebaad0928183e61df2c

executor: switch from `log` to `tracing` (#1454) ## Motivation The `tracing` crate implements scoped, structured, context-aware diagnostics, which can add significant debugging value over unstructured log messages. `tracing` is part of the Tokio project. As part of the `tokio` 0.2 changes, I thought it would be good to move over from `log` to `tracing` in the tokio runtime. Updating the executor crate is an obvious starting point. ## Solution This branch replaces the use of `log` in `tokio-executor` with `tracing`. I've tried to leave all the instrumentation points more or less the same, but modified to use structured fields instead of string interpolation. I've also added a few `tracing` spans, primarily in places where a variable is added to all the log messages in a scope. ## Notes For users who are using the legacy `log` output, there is a feature flag to enable `log` support in `tracing`. I thought about making this on by default, but that would also enable the `tracing` dependency by default, and it is only pulled in when the `threadpool` feature flag is enabled. The `tokio` crate could enable the log feature in its default features instead, since the threadpool feature is on by default in `tokio`. If this isn't the right approach, I can change how `log` back-compatibility is enabled. We might want to consider adding more `tracing` spans in the threadpool later. This could be useful for profiling, and for helping users debug the way their applications interact with the executor. This branch is just intended as a starting point so that we can begin emitting `tracing` data from the executor; we should revisit what instrumentation should be exposed, as well. Signed-off-by: Eliza Weisman <eliza@buoyant.io>

view details

Taiki Endo

commit sha a791f4a758604768463d3ca2162b913dcea34c40

chore: bump to newer nightly (#1485)

view details

Taiki Endo

commit sha 24fb33e0129e6bea80469388d6bb73cd71a178c2

io: add AsyncReadExt::{chain, take} (#1484)

view details

push time in 4 days

PR opened hyperium/hyper-tls

chore: async_await is stable on nightly
+0 -5

0 comment

2 changed files

pr created time in 4 days

create barnch95th/hyper-tls

branch : async_stable

created branch time in 4 days

PR opened hyperium/h2

chore: async_await is stable on nightly
+0 -51

0 comment

20 changed files

pr created time in 4 days

create barnch95th/h2

branch : async_stable

created branch time in 4 days

PR opened hyperium/hyper-tls

small error handling cleanup
+1 -4

0 comment

1 changed file

pr created time in 5 days

push event95th/hyper-tls

Gurwinder Singh

commit sha 4f4ef7b687a0121e3a7a5b77582c451a7b491dfa

small error handling cleanup

view details

push time in 5 days

PR closed hyperium/hyper

Update Client API using async-await

The code becomes much cleaner with this approach (No polls, Eithers (nested sometimes))

Main difference now is that:

  1. No cloning is done inside retryably_send_request.
  2. Future returned by get and request methods now ties to lifetime of self. So the client has to be alive for lifetime of request future. User will have clone the client instance if needed.

@seanmonstar Please let me know what you think?

+210 -249

0 comment

4 changed files

95th

pr closed time in 5 days

push event95th/torrent-rs

Gurwinder Singh

commit sha ccd9ee1cbc2487c0d41bfcbedda1d19062e025a0

Update README.md

view details

push time in 6 days

push event95th/hyper

Alex Gaynor

commit sha c1d40f30b5423f1d489aa3466341cae1edff5fba

chore(dependencies): Bump spmc, since 0.2 was yanked

view details

Gurwinder Singh

commit sha c335d8f9652cb02efe39bf6b166fdbe5a580a122

Merge branch 'master' into master

view details

push time in 6 days

issue closedrust-lang-nursery/futures-rs

doc.rs shows build failure

docs.rs show error for the latest release

Capture

closed time in 6 days

95th

issue commentasync-rs/async-std

Provide test macro like `#[tokio::test]` or `#[runtime::test]`

Yes, the block_on is close, but macro feel more natural IMO. Also, block_on version has more boilerplate.

95th

comment created time in 7 days

delete branch 95th/torrent-rs

delete branch : azure-pipelines

delete time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha 3bc49de30801f8f7555ecb041c3333144e2ae349

Make CI cross platform (#4)

view details

push time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha 6b497bd5892f1d145903925968200318f6166456

Include conditional install rust

view details

push time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha b5ea8a57ca405ff552a6dac138223dd1698593f9

Include conditional install rust

view details

push time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha 8554484bb914e2ac3f45b982311145a2ebc41dd0

Cleanup

view details

push time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha b862f576b6148407010285e9e1359e65884b8b8f

Update

view details

push time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha f01a24c95e7125ba41407a9871530ce01c55043f

Update

view details

push time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha bb87fc0dbfa35a58af6b0ea0c362613386722a16

Update

view details

push time in 7 days

PR opened 95th/torrent-rs

Update azure-pipelines.yml for Azure Pipelines
+6 -1

0 comment

1 changed file

pr created time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha ff0a171002df5ed05c1f500d02581181235d484a

Update azure-pipelines.yml for Azure Pipelines

view details

push time in 7 days

create barnch95th/torrent-rs

branch : azure-pipelines

created branch time in 7 days

CommitCommentEvent

push event95th/torrent-rs

Gurwinder Singh

commit sha 06afaa8f6059d68130c3c1156c712642a68f3f9b

Move tests out

view details

push time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha 42a409f8f94ba05e3e4d90cf7eb660deec7a1502

Minor clean up

view details

push time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha 806c357656a6d9d3e167bad88aad4694ddc0ce99

Minor clean up

view details

push time in 7 days

push event95th/torrent-rs

Gurwinder Singh

commit sha 7a6e834aff41e91ed11f43aa6c7eab5488c1489a

Minor clean up

view details

push time in 7 days

create barnch95th/h2

branch : bench

created branch time in 7 days

fork 95th/h2

HTTP 2.0 client & server implementation for Rust.

fork in 7 days

issue openedasync-rs/async-std

Provide test macro like `#[tokio::test]` or `#[runtime::test]`

As as the title says, async_std should provide macro like #[tokio::test] or #[runtime::test] for writing tests.

created time in 8 days

push event95th/hyper

Gurwinder Singh

commit sha 760c91bd73d02fbf2e0847fd4d9cc04a8e7db38b

Update Client API using async-await

view details

Gurwinder Singh

commit sha 5a1c8a322ae5c5cbe0f135c5e09a4dd7709a7467

Update tests and examples

view details

push time in 8 days

delete branch 95th/h2

delete branch : fmt

delete time in 8 days

Pull request review commenthyperium/hyper

Upgrade some lib tests to async/.await version

 impl ConnectingTcp {  #[cfg(test)] mod tests {-    // FIXME: re-implement tests with `async/await`, this import should-    // trigger a warning to remind us-    use crate::Error;-    /*     use std::io;-    use futures::Future;++    use tokio::runtime::current_thread::Runtime;++    use crate::Error;     use super::{Connect, Destination, HttpConnector};      #[test]     fn test_errors_missing_authority() {+        let mut rt = Runtime::new().unwrap();         let uri = "/foo/bar?baz".parse().unwrap();         let dst = Destination {             uri,         };         let connector = HttpConnector::new(1); -        assert_eq!(connector.connect(dst).wait().unwrap_err().kind(), io::ErrorKind::InvalidInput);+        rt.block_on(async {+            assert_eq!(+                connector.connect(dst).await.unwrap_err().kind(),+                io::ErrorKind::InvalidInput,+            );+        })     }      #[test]     fn test_errors_enforce_http() {+        let mut rt = Runtime::new().unwrap();         let uri = "https://example.domain/foo/bar?baz".parse().unwrap();         let dst = Destination {             uri,         };         let connector = HttpConnector::new(1); -        assert_eq!(connector.connect(dst).wait().unwrap_err().kind(), io::ErrorKind::InvalidInput);+        rt.block_on(async {+            assert_eq!(+                connector.connect(dst).await.unwrap_err().kind(),+                io::ErrorKind::InvalidInput,+            );+        })     }       #[test]     fn test_errors_missing_scheme() {+        let mut rt = Runtime::new().unwrap();

#[tokio::test] will be a cleaner in async tests

weihanglo

comment created time in 8 days

create barnch95th/hyper

branch : h2-std-future

created branch time in 8 days

PR opened hyperium/h2

chore: enable RustFmt check in CI
+778 -859

0 comment

44 changed files

pr created time in 8 days

push event95th/h2

Gurwinder Singh

commit sha b8f32d127c67a3a66b38d79d45a79692d83d7ab0

Add Rustfmt to CI

view details

Gurwinder Singh

commit sha 95fa022bdd8f9c9c491976f96a8181f9c0e4104c

chore: cargo fmt, clippy

view details

push time in 8 days

push event95th/h2

Gurwinder Singh

commit sha dac7bb53b872aeeec2985689385f06d4b8a62aef

Add fmt check to CI

view details

Gurwinder Singh

commit sha 7f8aa39cf759ae1158eeacb508c24605c45bf2f7

Cargo fmt

view details

push time in 8 days

push event95th/h2

Gurwinder Singh

commit sha 9296681b7c2015922392af456e5565678e9d1228

Add fmt check to CI

view details

push time in 8 days

push event95th/h2

Gurwinder Singh

commit sha 99c9e8b6e0973a9596f374c7f36c628ecdb1c8d2

Add fmt check to CI

view details

push time in 8 days

create barnch95th/h2

branch : fmt

created branch time in 8 days

push event95th/h2

Gurwinder Singh

commit sha c8fefd49f185735821cad988a60903652318e278

Update lib to std-future

view details

Gurwinder Singh

commit sha 529ef4cd4028a5dd321d50def0e3664853cd0a93

Update h2-support to std-future

view details

Gurwinder Singh

commit sha 97a4c8049ce322e6e757b67e27d7efc448d8c9bc

Update h2-tests to std-future

view details

Gurwinder Singh

commit sha 517077c69864f7310c8b81043ff15b3f2286f0a8

Update h2-fuzz to std-future

view details

Gurwinder Singh

commit sha 0a4bd393ec6dbc84bfa0352faec043143173e52a

Update examples to std-future

view details

Gurwinder Singh

commit sha ad7ffa795fa5d3877aa717dae4caca12e89b164c

Updated as per review comments

view details

Gurwinder Singh

commit sha b039ef25bc820fa56e6ec1af6835b9321276cfa9

Make handshake an async fn; other cleanup

view details

push time in 8 days

push event95th/h2

Gurwinder Singh

commit sha d508ea7ad205b4adf51f1ea877539b7725ab04b2

Make handshake an async fn; other cleanup

view details

push time in 8 days

Pull request review commenthyperium/h2

Update to std::future

 use std::usize; /// /// [module]: index.html #[must_use = "futures do nothing unless polled"]-pub struct Handshake<T, B = Bytes> {+pub struct Handshake<'a, T, B = Bytes> {     builder: Builder,-    inner: WriteAll<T, &'static [u8]>,+    inner: Pin<Box<dyn Future<Output = io::Result<T>> + 'a>>,

Done 👍

95th

comment created time in 8 days

push event95th/h2

Gurwinder Singh

commit sha ef98e555e0056119c8166afb2eea07c56035d616

Make handshake an async fn; other cleanup

view details

push time in 8 days

issue commentsfackler/rust-openssl

OpenSSL not found on Ubuntu

It wasn't 😬. But installing it worked.

SuperCuber

comment created time in 9 days

fork 95th/tokio

A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language.

https://tokio.rs

fork in 9 days

Pull request review commenthyperium/h2

Update to std::future

 use std::usize; /// /// [module]: index.html #[must_use = "futures do nothing unless polled"]-pub struct Handshake<T, B = Bytes> {+pub struct Handshake<'a, T, B = Bytes> {     builder: Builder,-    inner: WriteAll<T, &'static [u8]>,+    inner: Pin<Box<dyn Future<Output = io::Result<T>> + 'a>>,

In hyper we store the handshake future in a state enum.

https://github.com/hyperium/hyper/blob/a503f8b3369ff24ce39ccf1a1da0d1d56366dabb/src/proto/h2/client.rs#L34-L37

Making handshake functions async will return an opaque future which we won't be able to store without Boxing. Will we update that area to async functions in hyper 0.13? From what I understand, Tokio is also moving towards async fns where possible. (recent examples: poll_accept vs accept, poll_ref vs recv_ref)

95th

comment created time in 9 days

Pull request review commenthyperium/h2

Update to std::future

 fn recv_invalid_server_stream_id() {     let (response, _) = client.send_request(request, true).unwrap();      // The connection errors-    assert!(h2.wait().is_err());+    assert!(h2.await.is_err());      // The stream errors-    assert!(response.wait().is_err());+    assert!(response.await.is_err()); } -#[test]-fn request_stream_id_overflows() {+#[tokio::test]+async fn request_stream_id_overflows() {     let _ = env_logger::try_init();-    let (io, srv) = mock::new();---    let h2 = client::Builder::new()-        .initial_stream_id(::std::u32::MAX >> 1)-        .handshake::<_, Bytes>(io)-        .expect("handshake")-        .and_then(|(mut client, h2)| {-            let request = Request::builder()-                .method(Method::GET)-                .uri("https://example.com/")-                .body(())-                .unwrap();--            // first request is allowed-            let (response, _) = client.send_request(request, true).unwrap();--            h2.drive(response).and_then(move |(h2, _)| {-                let request = Request::builder()-                    .method(Method::GET)-                    .uri("https://example.com/")-                    .body(())-                    .unwrap();+    let (io, mut srv) = mock::new();++    let h2 = async move {+        let (mut client, mut h2) = client::Builder::new()+            .initial_stream_id(::std::u32::MAX >> 1)+            .handshake::<_, Bytes>(io)+            .await+            .unwrap();+        let request = Request::builder()+            .method(Method::GET)+            .uri("https://example.com/")+            .body(())+            .unwrap(); -                // second cannot use the next stream id, it's over+        // first request is allowed+        let (response, _) = client.send_request(request, true).unwrap();+        let _x = h2.drive(response).await.unwrap(); -                let poll_err = client.poll_ready().unwrap_err();-                assert_eq!(poll_err.to_string(), "user error: stream ID overflowed");+        let request = Request::builder()+            .method(Method::GET)+            .uri("https://example.com/")+            .body(())+            .unwrap();+        // second cannot use the next stream id, it's over+        let poll_err = poll_fn(|cx| client.poll_ready(cx)).await.unwrap_err();+        assert_eq!(poll_err.to_string(), "user error: stream ID overflowed"); -                let err = client.send_request(request, true).unwrap_err();-                assert_eq!(err.to_string(), "user error: stream ID overflowed");+        let err = client.send_request(request, true).unwrap_err();+        assert_eq!(err.to_string(), "user error: stream ID overflowed"); -                h2.expect("h2").map(|ret| {-                    // Hold on to the `client` handle to avoid sending a GO_AWAY-                    // frame.-                    drop(client);-                    ret-                })-            })-        });+        h2.await.unwrap();+    }; -    let srv = srv.assert_client_handshake()-        .unwrap()-        .recv_settings()-        .recv_frame(+    let srv = async move {+        let settings = srv.assert_client_handshake().await;+        assert_default_settings!(settings);+        srv.recv_frame(             frames::headers(::std::u32::MAX >> 1)                 .request("GET", "https://example.com/")                 .eos(),         )-        .send_frame(-            frames::headers(::std::u32::MAX >> 1)-                .response(200)-                .eos()-        )-        .idle_ms(10)-        .close();+        .await;+        srv.send_frame(frames::headers(::std::u32::MAX >> 1).response(200).eos())+            .await;+        idle_ms(10).await;+    }; -    h2.join(srv).wait().expect("wait");+    join(srv, h2).await; } -#[test]-fn client_builder_max_concurrent_streams() {+#[tokio::test]+async fn client_builder_max_concurrent_streams() {     let _ = env_logger::try_init();-    let (io, srv) = mock::new();+    let (io, mut srv) = mock::new();      let mut settings = frame::Settings::default();     settings.set_max_concurrent_streams(Some(1)); -    let srv = srv-        .assert_client_handshake()-        .unwrap()-        .recv_custom_settings(settings)-        .recv_frame(+    let srv = async move {+        let rcvd_settings = srv.assert_client_handshake().await;+        assert_frame_eq(settings, rcvd_settings);++        srv.recv_frame(             frames::headers(1)                 .request("GET", "https://example.com/")-                .eos()+                .eos(),         )-        .send_frame(frames::headers(1).response(200).eos())-        .close();+        .await;+        srv.send_frame(frames::headers(1).response(200).eos()).await;+    };      let mut builder = client::Builder::new();     builder.max_concurrent_streams(1); -    let h2 = builder-        .handshake::<_, Bytes>(io)-        .expect("handshake")-        .and_then(|(mut client, h2)| {-            let request = Request::builder()-                .method(Method::GET)-                .uri("https://example.com/")-                .body(())-                .unwrap();--            let (response, _) = client.send_request(request, true).unwrap();-            h2.drive(response).map(move |(h2, _)| (client, h2))-        });+    let h2 = async move {+        let (mut client, mut h2) = builder.handshake::<_, Bytes>(io).await.unwrap();+        let request = Request::builder()+            .method(Method::GET)+            .uri("https://example.com/")+            .body(())+            .unwrap();+        let (response, _) = client.send_request(request, true).unwrap();+        h2.drive(response).await.unwrap();+    }; -    h2.join(srv).wait().expect("wait");+    join(srv, h2).await; } -#[test]-fn request_over_max_concurrent_streams_errors() {+#[tokio::test]+async fn request_over_max_concurrent_streams_errors() {     let _ = env_logger::try_init();-    let (io, srv) = mock::new();---    let srv = srv.assert_client_handshake_with_settings(frames::settings()-                // super tiny server-                .max_concurrent_streams(1))-        .unwrap()-        .recv_settings()-        .recv_frame(+    let (io, mut srv) = mock::new();++    let srv = async move {+        let settings = srv+            .assert_client_handshake_with_settings(+                frames::settings()+                    // super tiny server+                    .max_concurrent_streams(1),+            )+            .await;+        assert_default_settings!(settings);+        srv.recv_frame(             frames::headers(1)                 .request("POST", "https://example.com/")                 .eos(),         )-        .send_frame(frames::headers(1).response(200).eos())-        .recv_frame(frames::headers(3).request("POST", "https://example.com/"))-        .send_frame(frames::headers(3).response(200))-        .recv_frame(frames::data(3, "hello").eos())-        .send_frame(frames::data(3, "").eos())-        .recv_frame(frames::headers(5).request("POST", "https://example.com/"))-        .send_frame(frames::headers(5).response(200))-        .recv_frame(frames::data(5, "hello").eos())-        .send_frame(frames::data(5, "").eos())-        .close();--    let h2 = client::handshake(io)-        .expect("handshake")-        .and_then(|(mut client, h2)| {-            // we send a simple req here just to drive the connection so we can-            // receive the server settings.-            let request = Request::builder()-                .method(Method::POST)-                .uri("https://example.com/")-                .body(())-                .unwrap();+        .await;+        srv.send_frame(frames::headers(1).response(200).eos()).await;

I think the tests reflect the future usage. IMO async-await is much clearer than chaining. In fact combinators based chaining API is main reason I abandoned a project I started 2 years back. Async-await has finally made it look like regular code. It is just my opinion though.

Also, Tests were the major part of this work. The actual lib update was trivial.

Please let me know if you'd like me to revert it.

95th

comment created time in 9 days

Pull request review commenthyperium/h2

Update to std::future

 use std::usize; /// /// [module]: index.html #[must_use = "futures do nothing unless polled"]-pub struct Handshake<T, B = Bytes> {+pub struct Handshake<'a, T, B = Bytes> {     builder: Builder,-    inner: WriteAll<T, &'static [u8]>,+    inner: Pin<Box<dyn Future<Output = io::Result<T>> + 'a>>,

The problem is that the WriteAll struct is private now. One solution I have in mind is make the handshake fns async. The handshake path has only one asynchronous element and that is write_all. We can just await it right there in the handshake2 function. WDYT?

95th

comment created time in 9 days

Pull request review commenthyperium/h2

Update to std::future

 impl MockNotify {         }     } -    pub fn with<F: FnOnce() -> R, R>(&self, f: F) -> R {-        use futures::Async::Ready;-        use futures::future::poll_fn;+    pub fn with<F: FnOnce() -> R, R>(&self, _f: F) -> R {+        unimplemented!();

Yes. MockNotify is not used anymore.

95th

comment created time in 9 days

push event95th/h2

Gurwinder Singh

commit sha 582fa0dd57bd1a4d234c8bd0232014198c255e45

Updated as per review comments

view details

push time in 9 days

Pull request review commenthyperium/h2

Update to std::future

 where             // The order here matters:             // - poll_go_away may buffer a graceful shutdown GOAWAY frame             // - If it has, we've also added a PING to be sent in poll_ready-            if let Some(reason) = try_ready!(self.poll_go_away()) {-                if self.go_away.should_close_now() {-                    if self.go_away.is_user_initiated() {-                        // A user initiated abrupt shutdown shouldn't return-                        // the same error back to the user.-                        return Ok(Async::Ready(()));-                    } else {-                        return Err(RecvError::Connection(reason));+            match ready!(self.poll_go_away(cx)) {+                Some(Ok(reason)) => {+                    if self.go_away.should_close_now() {+                        if self.go_away.is_user_initiated() {+                            // A user initiated abrupt shutdown shouldn't return+                            // the same error back to the user.+                            return Poll::Ready(Ok(()));+                        } else {+                            return Poll::Ready(Err(RecvError::Connection(reason)));+                        }                     }+                    // Only NO_ERROR should be waiting for idle+                    debug_assert_eq!(+                        reason,+                        Reason::NO_ERROR,+                        "graceful GOAWAY should be NO_ERROR"+                    );                 }-                // Only NO_ERROR should be waiting for idle-                debug_assert_eq!(reason, Reason::NO_ERROR, "graceful GOAWAY should be NO_ERROR");+                Some(Err(e)) => return Poll::Ready(Err(e.into())),+                None => (),             }-            try_ready!(self.poll_ready());+            ready!(self.poll_ready(cx))?; -            match try_ready!(self.codec.poll()) {-                Some(Headers(frame)) => {+            match ready!(Pin::new(&mut self.codec).poll_next(cx)) {

Done

95th

comment created time in 9 days

Pull request review commenthyperium/h2

Update to std::future

 impl<T, B> FramedWrite<T, B> {     } } -impl<T: io::Read, B> io::Read for FramedWrite<T, B> {-    fn read(&mut self, dst: &mut [u8]) -> io::Result<usize> {-        self.inner.read(dst)-    }-}--impl<T: AsyncRead, B> AsyncRead for FramedWrite<T, B> {-    fn read_buf<B2: BufMut>(&mut self, buf: &mut B2) -> Poll<usize, io::Error>

Done

95th

comment created time in 9 days

Pull request review commenthyperium/h2

Update to std::future

 struct Process { }  impl Future for Process {-    type Item = ();-    type Error = h2::Error;+    type Output = Result<(), h2::Error>; -    fn poll(&mut self) -> Poll<(), h2::Error> {+    fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

Done 👍

95th

comment created time in 9 days

Pull request review commenthyperium/h2

Update to std::future

 members = [ ]  [dependencies]-futures = "0.1"-tokio-io = "0.1.4"+futures-preview = "0.3.0-alpha.18"+tokio-io = { git = "https://github.com/tokio-rs/tokio" }

Done 👍

95th

comment created time in 9 days

push event95th/h2

Gurwinder Singh

commit sha b165857efc2bba23749a8854385c342156fa2322

Updated as per review comments

view details

push time in 9 days

PR opened hyperium/hyper

Update Client API using async-await

The code becomes much cleaner with this approach (No polls, Eithers (nested sometimes))

Main difference now is that:

  1. No cloning is done inside retryably_send_request.
  2. Future returned by get and request methods now ties to lifetime of self. So the client has to be alive for lifetime of request future. User will have clone the client instance if needed.

@seanmonstar Please let me know what you think?

+210 -249

0 comment

4 changed files

pr created time in 10 days

push event95th/hyper

Gurwinder Singh

commit sha 5a1c8a322ae5c5cbe0f135c5e09a4dd7709a7467

Update tests and examples

view details

push time in 10 days

push event95th/hyper

Yotam Ofek

commit sha 9d5299b655b7db86462fdb3929acf16ce5c2f74d

refactor(server): work around deprecation of `poll_accept` method in tokio (#1890)

view details

Alex Gaynor

commit sha 7f1b5f52ba3a5fd88582fe813a3a90006c2333b8

chore(dependencies): update tokio to v0.2.0-alpha.1 Fixes #1893

view details

Kyle Huey

commit sha a503f8b3369ff24ce39ccf1a1da0d1d56366dabb

fix(client): impl<T: Connect> Connect for Box<T> (#1889)

view details

Gurwinder Singh

commit sha 760c91bd73d02fbf2e0847fd4d9cc04a8e7db38b

Update Client API using async-await

view details

push time in 10 days

push event95th/hyper

Gurwinder Singh

commit sha 218e80a2f33ced33594e2deea8dcd6d5f2010659

Update Client API using async-await

view details

push time in 10 days

issue commentrust-lang/rustfmt

Modules with path still can't be formatted on Windows

Hi @scampi, is there any update on this issue please?

95th

comment created time in 10 days

push event95th/h2

Gurwinder Singh

commit sha 7ee8378ccb232cc0a7f2cf8546a0ce1a7fbe9252

Update lib to std-future

view details

Gurwinder Singh

commit sha bb100a39bae9e604ee9c3571559f710fccdea855

Update h2-support to std-future

view details

Gurwinder Singh

commit sha a6e1db69b42de6d67b86428039ae4b426ec23ed1

Update h2-tests to std-future

view details

Gurwinder Singh

commit sha 2f621ebbde5ec4f7007cb0211bf0d7ca8e25fae9

Update h2-fuzz to std-future

view details

Gurwinder Singh

commit sha 78975e50aa71c1e6245ba39c40c360c7183f1a62

Update examples to std-future

view details

push time in 10 days

pull request commenthyperium/h2

[WIP] Update to std::future

@sgrif I rewrote commit history where each commit updates one area. Is that sufficient or do you want me to open separate PRs?

95th

comment created time in 10 days

pull request commenthyperium/h2

[WIP] Update to std::future

Looks like my own PR https://github.com/rust-lang/rust/issues/63514 has come back to bite me

95th

comment created time in 10 days

push event95th/h2

Gurwinder Singh

commit sha 8a00e09c430924310d9aa370da7f21680095933b

Update lib to std-future

view details

Gurwinder Singh

commit sha aaef2d459266499d84b9d810185b941a58a8bdf0

Update examples to std-future

view details

Gurwinder Singh

commit sha 15eed69d1177378debb79a06b7264d4a19b10843

Update h2-support to std-future

view details

Gurwinder Singh

commit sha ad9ca5945fb9bdaf9d9c4b2aab2332b751fdccde

Update h2-tests to std-future

view details

Gurwinder Singh

commit sha fdbea09765ca7b6f3cab30332a8617536894bab6

Update h2-fuzz to std-future

view details

push time in 10 days

push event95th/hyper

Gurwinder Singh

commit sha e5fa85c2f320f5e4612aa14d5691449ce22575e7

Fix failure due to tokio changes

view details

Gurwinder Singh

commit sha 29d7e7d4a3255d3963925bf75350f9ff31c1007b

Update some of client internals to use async-await

view details

push time in 11 days

issue openedrust-lang/rust

CI is shown stuck on github

The CI seems to be stuck on Github and jobs are shown running for more than a day but it has actually completed in Azure.

Capture

Capture

created time in 11 days

issue openedrust-lang-nursery/futures-rs

Docs build failure show on doc.rs

docs.rs show error for the latest release

Capture

created time in 11 days

Pull request review commenthyperium/h2

[WIP] Update to std::future

 //! //! # Example //!-//! ```rust+//! ```rust, no_run

Previously, any panics inside tokio::run didn't fail the test. Now it does. So, make this compile only.

95th

comment created time in 12 days

Pull request review commentrust-lang/rust

Provide map_ok and map_err method for Poll<Option<Result<T, E>>>

 impl<T, E> Poll<Result<T, E>> {     } } +impl<T, E> Poll<Option<Result<T, E>>> {+    /// Changes the success value of this `Poll` with the closure provided.+    pub fn map_ok<U, F>(self, f: F) -> Poll<Option<Result<U, E>>>+        where F: FnOnce(T) -> U+    {+        match self {+            Poll::Ready(Some(Ok(t))) => Poll::Ready(Some(Ok(f(t)))),+            Poll::Ready(Some(Err(e))) => Poll::Ready(Some(Err(e))),+            Poll::Ready(None) => Poll::Ready(None),+            Poll::Pending => Poll::Pending,+        }+    }++    /// Changes the error value of this `Poll` with the closure provided.+    pub fn map_err<U, F>(self, f: F) -> Poll<Option<Result<T, U>>>

Done. Thanks

95th

comment created time in 12 days

Pull request review commentrust-lang/rust

Provide map_ok and map_err method for Poll<Option<Result<T, E>>>

 impl<T, E> Poll<Result<T, E>> {     } } +impl<T, E> Poll<Option<Result<T, E>>> {+    /// Changes the success value of this `Poll` with the closure provided.+    pub fn map_ok<U, F>(self, f: F) -> Poll<Option<Result<U, E>>>

Done. Thanks

95th

comment created time in 12 days

push event95th/rust

Gurwinder Singh

commit sha 84cab928db8526af7c42e1637e7253a009da215d

Provide map_ok and map_err method for Poll<Option<Result<T, E>>>

view details

push time in 12 days

issue openedrust-lang/rust

Provide map_ok and map_err method for Poll<Option<Result<T, E>>>

Currently map_ok and map_err methods are given for Poll<Result<T, E>>.

We should provide similar methods for Poll<Option<Result<T, E>>> as they are helpful in stream building code.

Relate PR: https://github.com/rust-lang/rust/pull/63512

created time in 12 days

pull request commentrust-lang/rust

Provide map_ok and map_err method for Poll<Option<Result<T, E>>>

Hi @nikomatsakis is this change acceptable?

95th

comment created time in 12 days

pull request commenthyperium/hyper

Fix failing build due to tokio changes

@Blub Agree. and it would have perf implications as well in the real world. I asked Carl Lerche about it. We need to make a bigger change so that we can directly use async fns. I made an unsuccessful attempt at it.

@Byron I closed this PR because there were others like it.

95th

comment created time in 12 days

push event95th/rust

Gurwinder Singh

commit sha 44e58f748299111c0de9f7f1f6dda472bf0fe88f

Provide map_ok and map_err method for Poll<Option<Result<T, E>>>

view details

push time in 12 days

PR opened rust-lang/rust

Provide map_ok and map_err method for Poll<Option<Result<T, E>>>

Currently map_ok and map_err methods are given for Poll<Result<T, E>>.

This PR adds these methods for Poll<Option<Result<T, E>>> as they are helpful in stream building code.

+26 -0

0 comment

1 changed file

pr created time in 12 days

push event95th/rust

Gurwinder Singh

commit sha 5be725f94ea68f3365d3c4d56b0bfb9af57a9bda

Provide map_ok and map_err method for Poll<Option<Result<T, E>>>

view details

push time in 12 days

fork 95th/rust

Empowering everyone to build reliable and efficient software.

https://www.rust-lang.org

fork in 12 days

fork 95th/hyper

An HTTP library for Rust

https://hyper.rs

fork in 12 days

push event95th/h2

Gurwinder Singh

commit sha bdfa42a693694c4bd98144bc03118c54300691fa

Fix failing tests

view details

push time in 13 days

push event95th/h2

Gurwinder Singh

commit sha 822fa8206654a066a6186defd0c1fe6beae7108b

Fix failing tests

view details

push time in 13 days

PR closed hyperium/hyper

Fix failing build due to tokio changes
+8 -2

0 comment

2 changed files

95th

pr closed time in 13 days

push event95th/h2

Gurwinder Singh

commit sha 08611518ede5251d2b15e6d04d5c1c17048b3128

Fix most of failing tests

view details

push time in 13 days

push event95th/h2

Gurwinder Singh

commit sha fab8b586775f2524591ca3dd34ce8dcbd20f5996

Fix most of failing tests

view details

push time in 13 days

push event95th/h2

Gurwinder Singh

commit sha 79ad222518cb1eeada799815e74aacd7a6f0f7b9

Fix more tests

view details

push time in 13 days

push event95th/h2

Gurwinder Singh

commit sha 908440d12431746890f32a73b17f4a4972920c93

Fix more tests

view details

push time in 13 days

more