profile
viewpoint
Jeremiah Senkpiel Fishrock123 hire me to do Rust!! Unceded Sḵwx̱wú7mesh Úxwumixw territory www.jeremiah-senkpiel.com Indie game dev, Rust dev, former Node.js TSC member — he or they

AndreasMadsen/dprof 72

Dynamic/structured profiling & visualization for sync and async operations

Fishrock123/bob 68

🚰 binary data "streams+" via data producers, data consumers, and pull flow.

async-rs/duplexify 42

Combine a reader + writer into a duplex of Read + Write

Fishrock123/beautify-benchmark 29

Beautify Benchmark.js's output into readable form.

Fishrock123/asteroids-webgl 2

My first actually published game, developed in late 2017 as an easter egg within N|Solid.

Fishrock123/ayo 1

It's pronounced like "IO" would be in English

Fishrock123/build 1

Better build and test infra for Node.

Fishrock123/cli-status 1

Highly configurable status indicators for your node.js cli.

Fishrock123/api-cdi 0

Collaborative Development Initiative for Public APIs

Pull request review commenthttp-rs/tide

rework landing docs

-//! # Serve the web-//!-//! Tide is a friendly HTTP server built for casual Rustaceans and veterans alike. It's completely-//! modular, and built directly for `async/await`. Whether it's a quick webhook, or an L7 load-//! balancer, Tide will make it work.-//!-//! # Features-//!-//! - __Fast:__ Written in Rust, and built on Futures, Tide is incredibly efficient.-//! - __Friendly:__ With thorough documentation, and a complete API, Tide helps cover your every-//!     need.-//! - __Minimal:__ With only a few concepts to learn, Tide is easy to pick up and become productive-//!     with.+//! Tide is a minimal and pragmatic Rust web application framework built for+//! rapid development. It comes with a robust set of features that make+//! building database-backed web applications easier and more fun.

Can we update the Cargo.toml description with this too?

yoshuawuyts

comment created time in 9 hours

PullRequestReviewEvent

pull request commentyoshuawuyts/kv-log-macro

Enable `std` feature in `log` dependency

This seems reasonable if it wasn't already no_std capable.

rossmacarthur

comment created time in 10 hours

Pull request review commenthttp-rs/http-types

Make async-std optional

 impl Body {     /// # Examples     ///     /// ```-    /// # fn main() -> Result<(), http_types::Error> { async_std::task::block_on(async {+    /// # fn main() -> Result<(), http_types::Error> { futures_lite::future::block_on(async {

Ah I suppose we may want to leave the hidden ones as is then...

akhilles

comment created time in 12 hours

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentrust-lang/rust-clippy

lints: clarify rc_buffer and add caveats

cc @yaahc, since she reviewed the original pr.

Fishrock123

comment created time in 12 hours

pull request commentrust-lang/rust-clippy

Add `rc_buffer` lint for checking Rc<String> and friends

So to elaborate more on Tide & Surf's usage:

The structure we have is Arc<Vec<Arc<dyn Middleware>>>, in both tide::Server and surf::Client.

The outer Arc exists to be able to handle things per-request, in both Tide and Surf, in both cases to get around a bunch of lifetime indirection I really don't understand. Both are constructed at runtime, so we need a Vec so people can add middleware (via .with(middleware)). The inner Arc exists due to an inner clone in Surf, and sharing between routes in Tide.

In both cases, the following information from the lint is not true:

    /// While mutating a buffer type would still be possible with Rc::get_mut(), it only
    /// works if there are no additional references yet, which defeats the purpose of
    /// enclosing it in a shared ownership type. Instead, additionally wrapping the inner
    /// type with an interior mutable container (such as RefCell or Mutex) would normally
    /// be used.

This is because the behavior described is useful to both Surf and Tide. Middleware needs to be mutable up-front, but once a Client or Server is executing on a request, messing with the middleware would lead to unexpected (and probably zalgo-esque timing bug) behavior, so having it panic is fine, because that is considered a programmer error.

rschoon

comment created time in 12 hours

PR opened rust-lang/rust-clippy

lints: clarify rc_buffer and add caveats

This didn't display some types properly in the docs due the lack of code formatting.

Also, refs for the caveat: https://github.com/rust-lang/rust-clippy/pull/6044#issuecomment-699559082 https://github.com/http-rs/surf/pull/242

Fwiw I can't get cargo test to run, even on nightly. I get: error[E0463]: can't find crate forrustc_ast``.

Please keep the line below changelog: none, nightly

+8 -7

0 comment

1 changed file

pr created time in 13 hours

create barnchFishrock123/rust-clippy

branch : rc_buffer-formatting-caveats

created branch time in 13 hours

PR opened http-rs/tide

ci, src: run clippy on nightly, apply fixes

The rc_buffer thing is similar to https://github.com/http-rs/surf/pull/242, refs https://github.com/rust-lang/rust-clippy/pull/6044

+11 -3

0 comment

3 changed files

pr created time in 13 hours

push eventFishrock123/tide

Jeremiah Senkpiel

commit sha 97147f0c3482e5553c251fc3e3eb2751c26bc98c

ci, src: run clippy on nightly, apply fixes The rc_buffer thing is similar to https://github.com/http-rs/surf/pull/242

view details

push time in 13 hours

create barnchFishrock123/tide

branch : clippy-nightly-lint

created branch time in 13 hours

PR opened http-rs/surf

client: ignore rc_buffer clippy warning

This new lint popped up overnight, see https://github.com/rust-lang/rust-clippy/pull/6044

The problem is that we do indeed want this structure.

  • The outer Arc allows us to clone in .send() without cloning the array.
  • The Vec allows us to add middleware at runtime.
  • The inner Arc-s allow us to implement Clone without sharing the vector with the parent.
  • We don't use a Mutex around the Vec here because adding a middleware during execution should be an error.
+7 -0

0 comment

1 changed file

pr created time in 16 hours

create barnchFishrock123/surf

branch : ignore-clippy-rc-buffer

created branch time in 16 hours

fork Fishrock123/rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code

https://rust-lang.github.io/rust-clippy/

fork in 18 hours

push eventFishrock123/surf

Jeremiah Senkpiel

commit sha 66b2191489da8dc4e5714b0de5377961aae40c5c

client: make with_http_client() generic This avoids leaking out the storage underneath. Internally we require a function like the original though, due to very confusing & indirect lifetime requirements.

view details

Jeremiah Senkpiel

commit sha 1ea7fbbeefe3e69a6686aa10dbd3432aeb9c60fe

Merge pull request #238 from Fishrock123/client-with-http-client-improve client: make with_http_client() generic

view details

Jeremiah Senkpiel

commit sha b531f93bc0c351553ee28798567c4f7ef91d96d6

docs: fix some docs & comments in RequestBuilder

view details

Jeremiah Senkpiel

commit sha f3bb33a9afe0e210dcdcf598fc4d54dd1a1e5c0c

src: simplify the return type of hidden main in doctests

view details

Jeremiah Senkpiel

commit sha cc395b273a5ed9e3c94dc6b4882c5f7a9e7a5ec1

doc: update examples in readme to alpha.5 apis

view details

Jeremiah Senkpiel

commit sha bd09c6c5f42610867602bd4a1def5bcd4c60d87e

doc: update for surf::client() and Client::new()

view details

push time in 18 hours

push eventhttp-rs/surf

Jeremiah Senkpiel

commit sha 49ee11068a229cc156a58acb423a1a8b8edfea29

deps, client: update for HttpClient 6.0 All of the global shared client now uses just one Arc. Refs: https://github.com/http-rs/http-client/pull/48

view details

Jeremiah Senkpiel

commit sha 4d97d6d0be726bed93e7dd7522a820e489c47131

Merge pull request #240 from Fishrock123/httpclient-no-clone deps, client: update for HttpClient 6.0

view details

push time in 18 hours

PR merged http-rs/surf

deps, client: update for HttpClient 6.0

All of the global shared client now uses just one Arc.

Refs: https://github.com/http-rs/http-client/pull/48

+3 -4

1 comment

2 changed files

Fishrock123

pr closed time in 18 hours

delete branch Fishrock123/tide

delete branch : DCO-1.1

delete time in 19 hours

issue commentnodejs/node

Less accurate and faster setTimeout

I suspect this may lead to lots of complaints, since people seem to care a bit about timers accuracy (for some reason).

I do think there are times when ~100-200ms timeouts are useful, would caching every 100ms be worthwhile? I dunno.

ronag

comment created time in 20 hours

PR opened http-rs/surf

2.0.0-alpha.6

This is an alpha release in preparation of 2.0.0, so you can start using Surf with stable futures. The aim is for this to be the last 2.0 alpha release.

As of this release, surf::get(), surf::post(), etc, now use a globally shared client internally, allowing for easier access to optimizations such as connection pooling.

Removals

  • Removed native-client feature flag in favor of direct curl-client default.

Changes

  • wasm-client feature is no longer automatic and must be set via cargo features.
  • All client feature flags are now mutually exclusive. curl-client is the default.
  • surf::method_name "one-off" methods now use a shared client internally if the client is curl-client. (Default)
  • Client::with_http_client() is now generic for any HttpClient rather than taking an Arc<dyn HttpClient>.
    • (The http client is still stored internally as a dynamic pointer.)
  • HttpClient has been upgraded to 6.0, removing Clone from the built in client backends.

Fixes

  • Surf can once again build with --no-default-features (and no client).
  • Doc updates

Internal

  • wasm-client now has proper headless browser CI testing.
+29 -5

0 comment

2 changed files

pr created time in 2 days

create barnchFishrock123/surf

branch : alpha.6

created branch time in 2 days

push eventFishrock123/surf

Jeremiah Senkpiel

commit sha 49ee11068a229cc156a58acb423a1a8b8edfea29

deps, client: update for HttpClient 6.0 All of the global shared client now uses just one Arc. Refs: https://github.com/http-rs/http-client/pull/48

view details

push time in 2 days

pull request commenthttp-rs/surf

deps, client: update for HttpClient 6.0

2.0 milestone due to httpClient semver upgrade

Fishrock123

comment created time in 2 days

push eventFishrock123/surf

Jeremiah Senkpiel

commit sha 2537c25d8fea95834c27e363cebdf2a0094ac134

deps, client: update for HttpClient 6.0 All of the global shared client now uses just one Arc. Refs: https://github.com/http-rs/http-client/pull/48

view details

push time in 2 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha 1c59a5274bc7531425cdcaeb3f95c0e073404a9b

src: correctly translate hyper body stream to ours Fixes a bug from 8bcf81f

view details

Jeremiah Senkpiel

commit sha 6b06bf1b6ac70c60f0ac3ef6cee606115a428016

Merge pull request #44 from Fishrock123/fix-hyper-body src: correctly translate hyper body stream to ours

view details

Jeremiah Senkpiel

commit sha edff06f7727027967338132d498483504f863bdb

meta: fix changelog formatting

view details

Jeremiah Senkpiel

commit sha 3cfd120d6ea6d9da6b35dae6355e1953691202d3

5.0.1

view details

Jeremiah Senkpiel

commit sha 4a1dc8286de5542aa5f39bd79956a614466720c4

src: remove Clone from HttpClient impls

view details

Jeremiah Senkpiel

commit sha d9d7e33a68ea4057812ca5ab522108053b65a300

h1: require constructor Prevents users from writing `HttpClient {}`.

view details

Jeremiah Senkpiel

commit sha 6409e37ec54264abc97b11cb184e596fdc5be2c9

Merge pull request #48 from Fishrock123/no-clone No Clone for HttpClient-s

view details

Jeremiah Senkpiel

commit sha 2431e8e0bc6ab27dece42c6897192e7ca2817d19

6.0.0

view details

push time in 2 days

push eventhttp-rs/http-client

Jeremiah Senkpiel

commit sha 2431e8e0bc6ab27dece42c6897192e7ca2817d19

6.0.0

view details

push time in 2 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha 4a1dc8286de5542aa5f39bd79956a614466720c4

src: remove Clone from HttpClient impls

view details

Jeremiah Senkpiel

commit sha d9d7e33a68ea4057812ca5ab522108053b65a300

h1: require constructor Prevents users from writing `HttpClient {}`.

view details

Jeremiah Senkpiel

commit sha 6409e37ec54264abc97b11cb184e596fdc5be2c9

Merge pull request #48 from Fishrock123/no-clone No Clone for HttpClient-s

view details

Jeremiah Senkpiel

commit sha 5703470a60f1826624e30a89dbf9c14b2af423a6

hyper: Clone & Default, re-use internal client - Makes HyperClient impl Clone and Default - Re-uses the internal hyper client for pooling and alloc efficiency - Adds HyperClient::from_client() - Always uses the HttpsConnector (has internal http fallback) Required for hyper-client in Surf: https://github.com/http-rs/surf/pull/234

view details

Jeremiah Senkpiel

commit sha fdf9847755171ea4d433d1681f73f7d58236e75f

hyper: avoid leaking generics into HttpClient Avoid leaking Hyper generics into HttpClient by hiding it behind a dynamic trait object pointer.

view details

Jeremiah Senkpiel

commit sha a0a9a049dd3b20dcceabb8b4802063889a833990

hyper: minor code improvements

view details

Jeremiah Senkpiel

commit sha e2c9f00937dc4ee802f13c3904505dadf1c7f4d9

hyper: remove Clone See https://github.com/http-rs/http-client/pull/48

view details

push time in 2 days

push eventhttp-rs/http-client

Jeremiah Senkpiel

commit sha 4a1dc8286de5542aa5f39bd79956a614466720c4

src: remove Clone from HttpClient impls

view details

Jeremiah Senkpiel

commit sha d9d7e33a68ea4057812ca5ab522108053b65a300

h1: require constructor Prevents users from writing `HttpClient {}`.

view details

Jeremiah Senkpiel

commit sha 6409e37ec54264abc97b11cb184e596fdc5be2c9

Merge pull request #48 from Fishrock123/no-clone No Clone for HttpClient-s

view details

push time in 2 days

PR merged http-rs/http-client

No Clone for HttpClient-s

(Based on https://github.com/http-rs/http-client/pull/45 for future simplicity.)

An alternate to https://github.com/http-rs/http-client/pull/47 "src: require Clone for HttpClient", this PR removes Clone impls from all HttpClients.

This is an alternate to the bottom part of https://github.com/http-rs/surf/issues/237 / https://github.com/http-rs/http-client/issues/46

The idea is to avoid multiple Arcs, and this pushes the responsibility for sharing a client to the upper client, i.e. Surf. Surf already has to have a pointer for every client anyways, so as to hide the generic from its Client definition.

+7 -30

0 comment

3 changed files

Fishrock123

pr closed time in 2 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha 4a1dc8286de5542aa5f39bd79956a614466720c4

src: remove Clone from HttpClient impls

view details

Jeremiah Senkpiel

commit sha d9d7e33a68ea4057812ca5ab522108053b65a300

h1: require constructor Prevents users from writing `HttpClient {}`.

view details

push time in 2 days

Pull request review commentnodejs/node

timers: add default value to Timeout 'after' param

 function initAsyncResource(resource, type) {  // Timer constructor function. // The entire prototype is defined in lib/timers.js-function Timeout(callback, after, args, isRepeat, isRefed) {-  after *= 1; // Coalesce to number or NaN

I think this line is still necessary for things that are not undefined.

wjabbour

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

startedmuseun/twitchchat

started time in 2 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha 14deef8d5c1ed04f5a4985d1340cba276958a645

hyper: remove Clone See https://github.com/http-rs/http-client/pull/48

view details

push time in 3 days

PR opened http-rs/surf

deps, client: update for HttpClient 6.0

All of the global shared client now uses just one Arc.

Refs: https://github.com/http-rs/http-client/pull/48

+3 -4

0 comment

2 changed files

pr created time in 3 days

push eventFishrock123/surf

Jeremiah Senkpiel

commit sha c554966ca2d5b7954c860454d44304e55f0a222f

deps, client: update for HttpClient 6.0 All of the global shared client now uses just one Arc. Refs: https://github.com/http-rs/http-client/pull/48

view details

push time in 3 days

create barnchFishrock123/surf

branch : httpclient-no-clone

created branch time in 3 days

push eventFishrock123/surf

Jacob Rothstein

commit sha da849f1e51c4f16ddb911ae194de1b9321423d20

actually test wasm

view details

Jacob Rothstein

commit sha 458ecd25fb93a4b32388515295d373b608bea955

simplify some of the feature flagging in client

view details

Jacob Rothstein

commit sha f4e5163a8532fee1eae217c1d060a131c0ccc86b

don't pass --all when it's unneeded

view details

Jacob Rothstein

commit sha 2effeee7157faa36ae3783fe87d1f48f364c685b

remove wasm_bindgen feature

view details

Jacob Rothstein

commit sha 17b1f50a9a3aeaf5628e2613bae007efa4d3fbd8

fix formatting of cargo.toml really need to set up a formatter

view details

Jacob Rothstein

commit sha 70abf302bafa5876790b15ff895994a09a9c2e10

allow surf to build with --no-default-features

view details

Jacob Rothstein

commit sha 2d2b79a26ebf4a945754ff62e6512ff1747f452b

add a ci test for --no-default-features

view details

Jeremiah Senkpiel

commit sha 66b2191489da8dc4e5714b0de5377961aae40c5c

client: make with_http_client() generic This avoids leaking out the storage underneath. Internally we require a function like the original though, due to very confusing & indirect lifetime requirements.

view details

Jeremiah Senkpiel

commit sha 1ea7fbbeefe3e69a6686aa10dbd3432aeb9c60fe

Merge pull request #238 from Fishrock123/client-with-http-client-improve client: make with_http_client() generic

view details

push time in 3 days

PR closed http-rs/surf

client: make global client work with non-Clone HttpClient

This is mostly required by the hyper client, so this is based on https://github.com/http-rs/surf/pull/234 for future simplicity. https://github.com/http-rs/surf/pull/238 will also create some conflicts here but they shouldn't be too difficult to solve.

+15 -8

0 comment

3 changed files

Fishrock123

pr closed time in 3 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha f2f5487e2b7a29d85862afcc9fed1d6d17389d11

src: remove Clone from HttpClient impls

view details

push time in 3 days

push eventhttp-rs/surf

Jeremiah Senkpiel

commit sha 66b2191489da8dc4e5714b0de5377961aae40c5c

client: make with_http_client() generic This avoids leaking out the storage underneath. Internally we require a function like the original though, due to very confusing & indirect lifetime requirements.

view details

Jeremiah Senkpiel

commit sha 1ea7fbbeefe3e69a6686aa10dbd3432aeb9c60fe

Merge pull request #238 from Fishrock123/client-with-http-client-improve client: make with_http_client() generic

view details

push time in 3 days

PR merged http-rs/surf

Reviewers
client: make with_http_client() generic

This avoids leaking out the storage underneath.

Internally we require a function like the original though, due to very confusing & indirect lifetime requirements.

I didn't like the api here to begin with, so this seems very reasonable to get in to 2.0

+10 -5

0 comment

1 changed file

Fishrock123

pr closed time in 3 days

PullRequestEvent

PR closed http-rs/surf

client: make global client work with non-Clone HttpClient

This is mostly required by the hyper client, so this is based on https://github.com/http-rs/surf/pull/234 for future simplicity. https://github.com/http-rs/surf/pull/238 will also create some conflicts here but they shouldn't be too difficult to solve.

+15 -8

0 comment

3 changed files

Fishrock123

pr closed time in 3 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha 868ffd2c901b8678f97ab217e6023aa922411a30

src: remove Clone from HttpClient impls

view details

push time in 3 days

PR opened http-rs/surf

client: make global client work with non-Clone HttpClient

This is mostly required by the hyper client, so this is based on https://github.com/http-rs/surf/pull/234 for future simplicity. https://github.com/http-rs/surf/pull/238 will also create some conflicts here but they shouldn't be too difficult to solve.

+15 -8

0 comment

3 changed files

pr created time in 3 days

create barnchFishrock123/surf

branch : hyper-client-no-clone

created branch time in 3 days

PR opened http-rs/http-client

No Clone for HttpClient-s

(Based on https://github.com/http-rs/http-client/pull/45 for future simplicity.)

An alternate to https://github.com/http-rs/http-client/pull/47 "src: require Clone for HttpClient", this PR removes Clone impls from all HttpClients.

This is an alternate to the bottom part of https://github.com/http-rs/surf/issues/237 / https://github.com/http-rs/http-client/issues/46

The idea is to avoid multiple Arcs, and this pushes the responsibility for sharing a client to the upper client, i.e. Surf. Surf already has to have a pointer for every client anyways, so as to hide the generic from its Client definition.

+48 -65

0 comment

4 changed files

pr created time in 3 days

create barnchFishrock123/http-client

branch : no-clone

created branch time in 3 days

PullRequestEvent

PR closed http-rs/surf

crate: add hyper-client feature

Adds support for http-client/hyper_client, including global pooling for one-off surf methods.

Also adjusts client configuration to fallback once again, starting with the highest specificity (wasm) and allowing e.g. features = ["hyper-client"] to override the default.

+14 -7

3 comments

3 changed files

Fishrock123

pr closed time in 3 days

PullRequestEvent

PR closed http-rs/http-client

hyper: Clone & Default, re-use internal client
  • Makes HyperClient impl Clone and Default
  • Re-uses the internal hyper client for pooling and alloc efficiency
  • Adds HyperClient::from_client()
  • Always uses the HttpsConnector (has internal http fallback)

Required for hyper-client in Surf: https://github.com/http-rs/surf/pull/234

+50 -31

1 comment

1 changed file

Fishrock123

pr closed time in 3 days

push eventFishrock123/surf

Jeremiah Senkpiel

commit sha 35ac557702a7d0ee03d41302a6e89ef252e5665f

crate: update metadata - improve cargo description - add keywords - update authors

view details

Jeremiah Senkpiel

commit sha 87a8fc199707783a49479ccd026a4f6c1674b93f

Merge pull request #227 from Fishrock123/cargo-metadata crate: update metadata

view details

Jeremiah Senkpiel

commit sha 61796e1ead1550a07a75cf738ee293a31332481c

src: feature flag each backend independently No longer has a magic wasm default, wasm must be specified independently. Opens room for per-backend optimization (such as Isahc singleton).

view details

Jeremiah Senkpiel

commit sha 0129e07036a90ada2991e54711998f1fc981de8f

src: add cgf for the wasm_bindgen feature Apparently the wasm-bindgen tool automatically passes this feature flag, which is handy, because we can use it to have a better way to automatically detect wasm and also exclude other backends from such a build.

view details

Jeremiah Senkpiel

commit sha 37cf9ad7a7fdf695f26de9f0b18049dd417a413b

Merge pull request #230 from Fishrock123/wasm-flag src: feature flag each backend independently

view details

Jeremiah Senkpiel

commit sha 9460c478491ccc4e16b18856835b554a64185b5b

RequestBuilder: use shared client internally if available This should help reduce overhead from creating new Isahc clients. See https://docs.rs/isahc/0.9.8/isahc/struct.HttpClient.html From Isahc's Docs: > The client maintains a connection pool internally and is not cheap to create ...

view details

Jeremiah Senkpiel

commit sha a0b9712e0971751cf177e08b723dfcc2aeae17e4

Merge pull request #231 from Fishrock123/isahc-singleton RequestBuilder: use shared client internally if available

view details

Jacob Rothstein

commit sha e8093da29a793661f60bb5721eb1efec408c8921

proposed feature changes for wasm functionality on 2.x

view details

Jacob Rothstein

commit sha 33f0e04767ad160660d7aa3a5b557c29a73026eb

show that we're using http_client::isahc::IsahcClient in the docs Co-authored-by: Jeremiah Senkpiel <fishrock123@rocketmail.com>

view details

Jeremiah Senkpiel

commit sha 690ed8002a394c85b696930c7976ffa6d445804b

Merge pull request #232 from jbr/features-for-wasm-on-2.0 feature changes for wasm support on 2.x

view details

Jacob Rothstein

commit sha da849f1e51c4f16ddb911ae194de1b9321423d20

actually test wasm

view details

Jacob Rothstein

commit sha 458ecd25fb93a4b32388515295d373b608bea955

simplify some of the feature flagging in client

view details

Jacob Rothstein

commit sha f4e5163a8532fee1eae217c1d060a131c0ccc86b

don't pass --all when it's unneeded

view details

Jacob Rothstein

commit sha 2effeee7157faa36ae3783fe87d1f48f364c685b

remove wasm_bindgen feature

view details

Jacob Rothstein

commit sha 17b1f50a9a3aeaf5628e2613bae007efa4d3fbd8

fix formatting of cargo.toml really need to set up a formatter

view details

Jacob Rothstein

commit sha 70abf302bafa5876790b15ff895994a09a9c2e10

allow surf to build with --no-default-features

view details

Jacob Rothstein

commit sha 2d2b79a26ebf4a945754ff62e6512ff1747f452b

add a ci test for --no-default-features

view details

Jeremiah Senkpiel

commit sha bdce05ef4e7884666c7cc56e1e83aae2a9a2f15a

docs: fix some docs & comments in RequestBuilder

view details

Jeremiah Senkpiel

commit sha 617c97e3940ecbeca70240c601aff6b433228f6c

src: simplify the return type of hidden main in doctests

view details

Jeremiah Senkpiel

commit sha 64f99119840385233cd1bd39c476814287f56500

doc: update examples in readme to alpha.5 apis

view details

push time in 3 days

push eventFishrock123/surf

Jeremiah Senkpiel

commit sha 66b2191489da8dc4e5714b0de5377961aae40c5c

client: make with_http_client() generic This avoids leaking out the storage underneath. Internally we require a function like the original though, due to very confusing & indirect lifetime requirements.

view details

push time in 3 days

issue commenthttp-rs/surf

Rework Client constructors

I've made a PR for

pub fn with_http_client<C: HttpClient>(http_client: C) -> Self

since that seems easy enough to do and I'm pretty sure the existing public Arc-taking one nobody liked: https://github.com/http-rs/surf/pull/238

yoshuawuyts

comment created time in 3 days

PR opened http-rs/surf

client: make with_http_client() generic

This avoids leaking out the stiorage underneath.

Internally we require a function like the original though, due to very confusing & indirect lifetime requirements.

I didn't like the api here to begin with, so this seems very reasonable to get in to 2.0

+10 -4

0 comment

1 changed file

pr created time in 3 days

create barnchFishrock123/surf

branch : client-with-http-client-improve

created branch time in 3 days

PullRequestEvent

PR closed http-rs/http-client

hyper: Clone & Default, re-use internal client
  • Makes HyperClient impl Clone and Default
  • Re-uses the internal hyper client for pooling and alloc efficiency
  • Adds HyperClient::from_client()
  • Always uses the HttpsConnector (has internal http fallback)

Required for hyper-client in Surf: https://github.com/http-rs/surf/pull/234

+50 -31

1 comment

1 changed file

Fishrock123

pr closed time in 3 days

pull request commentnodejs/node

process: Change default --unhandled-rejections=throw

Also 5 years later, I still believe this is the correct choice for Node.js. Thank you.

dfabulich

comment created time in 4 days

PullRequestEvent

PR closed http-rs/http-client

hyper: Clone & Default, re-use internal client
  • Makes HyperClient impl Clone and Default
  • Re-uses the internal hyper client for pooling and alloc efficiency
  • Adds HyperClient::from_client()
  • Always uses the HttpsConnector (has internal http fallback)

Required for hyper-client in Surf: https://github.com/http-rs/surf/pull/234

+50 -31

1 comment

1 changed file

Fishrock123

pr closed time in 4 days

issue commentasync-rs/async-std

Not compiling with nightly-2020-09-22-x86_64-unknown-linux-gnu

This is causing issues in downstream CI: https://github.com/http-rs/http-client/pull/45, https://github.com/http-rs/surf/pull/234

jerry73204

comment created time in 4 days

pull request commenthttp-rs/http-client

hyper: Clone & Default, re-use internal client

<details> <summary>That docs failure is not our own but rather async-std's</summary>

error[E0046]: not all trait items implemented, missing: `as_flags`
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.6.4/src/fs/open_options.rs:303:5
    |
303 |     impl OpenOptionsExt for OpenOptions {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `as_flags` in implementation
    |
    = help: implement the missing item: `fn as_flags(&self) -> std::result::Result<i32, futures_io::Error> { todo!() }`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0046`.
error: could not compile `async-std`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0046]: not all trait items implemented, missing: `as_flags`
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.6.4/src/fs/open_options.rs:303:5
    |
303 |     impl OpenOptionsExt for OpenOptions {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `as_flags` in implementation
    |
    = help: implement the missing item: `fn as_flags(&self) -> std::result::Result<i32, futures_io::Error> { todo!() }`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0046`.
error: build failed
Error: Process completed with exit code 101.

</details>

Fishrock123

comment created time in 4 days

pull request commenthttp-rs/surf

crate: add hyper-client feature

Hmm, CI is failing because something in async-std?

error[E0046]: not all trait items implemented, missing: `as_flags`
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.6.4/src/fs/open_options.rs:303:5
    |
303 |     impl OpenOptionsExt for OpenOptions {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `as_flags` in implementation
    |
    = help: implement the missing item: `fn as_flags(&self) -> std::result::Result<i32, futures_io::Error> { todo!() }`
Fishrock123

comment created time in 4 days

issue closedhttp-rs/http-client

HttpClient instances should be Clone

From: https://github.com/http-rs/surf/issues/237

Right now the Client::with_http_client method has the following signature:

pub fn with_http_client(http_client: Arc<dyn HttpClient>) -> Self;

This means that even if a backend we pass implements Clone, we must wrap it in another Arc. This leads to constructs such as:

let mut app = tide::new();
let mut client = Client::with_http_client(Arc::new(app));
client.set_base_url("http://example.com/");

Instead I'd like us to change the signature to:

pub fn connect_with<C>(http_client: C) -> crate::Result<Self>
where
    C: HttpClient + Clone;

Which will enable us to write:

let mut app = tide::new();
let mut client = Client::connect_with("http://example.com", app)?;

closed time in 4 days

Fishrock123

issue commenthttp-rs/http-client

HttpClient instances should be Clone

See https://users.rust-lang.org/t/why-cant-traits-require-clone/23686, this doesn't really work.

Fishrock123

comment created time in 4 days

PR closed http-rs/http-client

src: require Clone for HttpClient semver-major

This was largely already the case, just not enforced.

Fixes: https://github.com/http-rs/http-client/issues/46 Refs: https://github.com/http-rs/surf/issues/237

+2 -2

2 comments

2 changed files

Fishrock123

pr closed time in 4 days

pull request commenthttp-rs/http-client

src: require Clone for HttpClient

See https://users.rust-lang.org/t/why-cant-traits-require-clone/23686, this doesn't really work.

Fishrock123

comment created time in 4 days

PullRequestEvent

PR closed http-rs/http-client

hyper: Clone & Default, re-use internal client
  • Makes HyperClient impl Clone and Default
  • Re-uses the internal hyper client for pooling and alloc efficiency
  • Adds HyperClient::from_client()
  • Always uses the HttpsConnector (has internal http fallback)

Required for hyper-client in Surf: https://github.com/http-rs/surf/pull/234

+50 -31

1 comment

1 changed file

Fishrock123

pr closed time in 4 days

pull request commenthttp-rs/http-client

hyper: Clone & Default, re-use internal client

See https://users.rust-lang.org/t/why-cant-traits-require-clone/23686, this doesn't really work.

Fishrock123

comment created time in 4 days

push eventFishrock123/surf

Jacob Rothstein

commit sha 70abf302bafa5876790b15ff895994a09a9c2e10

allow surf to build with --no-default-features

view details

Jacob Rothstein

commit sha 2d2b79a26ebf4a945754ff62e6512ff1747f452b

add a ci test for --no-default-features

view details

Jeremiah Senkpiel

commit sha 8cbd454813665efb88cb43c527537a1b165e910c

crate: add hyper-client feature Adds support for `http-client/hyper_client`, including global pooling for one-off surf methods. Also adjusts client configuration to fallback once again, starting with the highest specificity (wasm) and allowing e.g. `features = ["hyper-client"]` to override the default.

view details

push time in 4 days

pull request commenthttp-rs/http-client

src: require Clone for HttpClient

Hmmm, actually, this is more complex than it appears. Surf depends on being able to use HttpClient as dynamic (unsized) trait objects (e.g. Arc<dyn HttpClient> and this prevents that from compiling because it requires Sized. 😕

Fishrock123

comment created time in 5 days

issue commenthttp-rs/surf

Connection pooling in Client / HttpClient

When https://github.com/http-rs/surf/pull/234 lands, the hyper-client will also have connection pooling built in.

Fishrock123

comment created time in 5 days

pull request commenthttp-rs/surf

crate: add hyper-client feature

This now only waiting for https://github.com/http-rs/http-client/pull/45

Fishrock123

comment created time in 5 days

push eventFishrock123/surf

Jeremiah Senkpiel

commit sha 08ff1084c25ebd8db5a603a5917361e2411119ad

crate: add hyper-client feature Adds support for `http-client/hyper_client`, including global pooling for one-off surf methods. Also adjusts client configuration to fallback once again, starting with the highest specificity (wasm) and allowing e.g. `features = ["hyper-client"]` to override the default.

view details

push time in 5 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha 72b1b72d8bd20c2cdafbc023ce8f75af9489bdff

hyper: avoid leaking generics into HttpClient Avoid leaking Hyper generics into HttpClient by hiding it behind a dynamic trait object pointer.

view details

Jeremiah Senkpiel

commit sha 9ccba5c931ac167613bb6acc53a8eda137083df3

hyper: minor code improvements

view details

push time in 5 days

push eventFishrock123/surf

Jeremiah Senkpiel

commit sha 8329257b6e66f6f011edcaa7fa7b0297f0a916d8

crate: add hyper-client feature Adds support for `http-client/hyper_client`, including global pooling for one-off surf methods. Also adjusts client configuration to fallback once again, starting with the highest specificity (wasm) and allowing e.g. `features = ["hyper-client"]` to override the default.

view details

push time in 5 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha 181fe1853ae8b35a83e967cdf796f8ea4245b76d

hyper: avoid leaking generics into HttpClient Avoid leaking Hyper generics into HttpClient by hiding it behind a dynamic trait object pointer.

view details

Jeremiah Senkpiel

commit sha 349d385f9fc601d34c37b9da394f92dd3b2fb702

hyper: minor code improvements

view details

push time in 5 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha bc5ff7eaf7c96780b6813cfc8d0be70421f3080e

hyper: avoid leaking generics into HttpClient Avoid leaking Hyper generics into HttpClient by hiding it behind a dynamic trait object pointer.

view details

Jeremiah Senkpiel

commit sha 84b26dadff729c3a36800c66fbcc24eeeabe8d17

hyper: minor code improvements

view details

push time in 5 days

push eventFishrock123/http-client

Jeremiah Senkpiel

commit sha 80e1af248494ff6630f6ed97de023780a2766af0

hyper: avoid leaking generics into HttpClient Avoid leaking Hyper generics into HttpClient by hiding it behind a dynamic trait object pointer.

view details

Jeremiah Senkpiel

commit sha c0714e92982058cdb7a2fa2859396c757a98e7c0

hyper: minor code improvements

view details

push time in 5 days

issue commenthttp-rs/surf

Rework Client constructors

For the rest, I think that would necessitate a ClientBuilder ...

Stated again, a base URL is not the only reason to use a Surf client:

  • Pooling already exists in the Isahc client without any modifications.
  • Pooling will exist in the Hyper client, without any API modifications. (https://github.com/http-rs/surf/pull/234)
  • One may want to have a client with a base set of middleware that is cloned and used to base other clients on.

Fwiw: Hyper also uses a builder for it's client (with far more fine-grained options).

yoshuawuyts

comment created time in 5 days

issue commenthttp-rs/surf

Rework Client constructors

The HttpClient thing is, frankly, largely separate and can be done already, separately from the concerns of the rest.

yoshuawuyts

comment created time in 5 days

PR opened http-rs/http-client

src: require Clone for HttpClient

This was largely already the case, just not enforced.

Fixes: https://github.com/http-rs/http-client/issues/46 Refs: https://github.com/http-rs/surf/issues/237

+2 -2

0 comment

2 changed files

pr created time in 5 days

create barnchFishrock123/http-client

branch : clone

created branch time in 5 days

issue openedhttp-rs/http-client

HttpClient instances should be Clone

From: https://github.com/http-rs/surf/issues/237

Right now the Client::with_http_client method has the following signature:

pub fn with_http_client(http_client: Arc<dyn HttpClient>) -> Self;

This means that even if a backend we pass implements Clone, we must wrap it in another Arc. This leads to constructs such as:

let mut app = tide::new();
let mut client = Client::with_http_client(Arc::new(app));
client.set_base_url("http://example.com/");

Instead I'd like us to change the signature to:

pub fn connect_with<C>(http_client: C) -> crate::Result<Self>
where
    C: HttpClient + Clone;

Which will enable us to write:

let mut app = tide::new();
let mut client = Client::connect_with("http://example.com", app)?;

created time in 5 days

PR opened http-rs/http-client

hyper: Clone & Default, re-use internal client
  • Makes HyperClient impl Clone and Default
  • Re-uses the internal hyper client for pooling and alloc efficiency
  • Adds HyperClient::from_client()
  • Always uses the HttpsConnector (has internal http fallback)

Required for hyper-client in Surf: https://github.com/http-rs/surf/pull/234

+28 -24

0 comment

1 changed file

pr created time in 5 days

create barnchFishrock123/http-client

branch : hyper-improvements

created branch time in 5 days

pull request commenthttp-rs/surf

crate: add hyper-client feature

I ahve discovered that this still doesn't work because Clone was never implemented for http_client::hyper::HyperClient.

Fishrock123

comment created time in 6 days

push eventFishrock123/surf

Jacob Rothstein

commit sha da849f1e51c4f16ddb911ae194de1b9321423d20

actually test wasm

view details

Jacob Rothstein

commit sha 458ecd25fb93a4b32388515295d373b608bea955

simplify some of the feature flagging in client

view details

Jacob Rothstein

commit sha f4e5163a8532fee1eae217c1d060a131c0ccc86b

don't pass --all when it's unneeded

view details

Jacob Rothstein

commit sha 2effeee7157faa36ae3783fe87d1f48f364c685b

remove wasm_bindgen feature

view details

Jacob Rothstein

commit sha 17b1f50a9a3aeaf5628e2613bae007efa4d3fbd8

fix formatting of cargo.toml really need to set up a formatter

view details

Jeremiah Senkpiel

commit sha f9316eab1e253590ca5499a82ea825d32743a941

src: remove #[cfg(any(<clients>))] conditionals As of 61796e1 a compile error will occur regardless.

view details

Jeremiah Senkpiel

commit sha f45eb79be576d536ea8612e4801c8b0f6d1d8071

crate: add hyper-client feature Adds support for `http-client/hyper_client`, including global pooling for one-off surf methods. Also adjusts client configuration to fallback once again, starting with the highest specificity (wasm) and allowing e.g. `features = ["hyper-client"]` to override the default.

view details

push time in 6 days

Pull request review commenthttp-rs/surf

Allow surf to build without a default client

 edition = "2018" # when the default feature set is updated, verify that the `--features` flags in # `.github/workflows/ci.yaml` are updated accordingly default = ["curl-client", "middleware-logger", "encoding"]-h1-client = ["http-client/h1_client"]-curl-client = ["http-client/curl_client", "once_cell"]-wasm-client = ["http-client/wasm_client"]+h1-client = ["http-client/h1_client", "default-client"]+curl-client = ["http-client/curl_client", "once_cell", "default-client"]+wasm-client = ["http-client/wasm_client", "default-client"]+default-client = []

Huh, upon examining https://doc.rust-lang.org/reference/conditional-compilation.html it seems I am misusing it in that PR. I have no idea how that PR manages to compile...

jbr

comment created time in 6 days

PullRequestReviewEvent

Pull request review commenthttp-rs/surf

Allow surf to build without a default client

 impl RequestBuilder {     }      /// Create a `Client` and send the constructed `Request` from it.-    pub fn send(self) -> BoxFuture<'static, Result<Response>> {-        if let Some(client) = self.client {-            client.send(self.req.unwrap()) // Ownership nonsense, same as `build()`.-        } else {-            let client = Client::new_shared();-            client.send(self.build())-        }+    pub fn send(mut self) -> BoxFuture<'static, Result<Response>> {+        self.client+            .take()+            .unwrap_or_else(Client::new_shared_or_panic)+            .send(self.build())

If this code didn't exist this could probably point to Client::default() which could use a shared client if available, changing this to .unwrap_or_default(), and eliminating new_shared() in the process? Maybe that would be confusing as it would differ from new() though.

jbr

comment created time in 6 days

PullRequestReviewEvent

Pull request review commenthttp-rs/surf

Allow surf to build without a default client

 impl Future for RequestBuilder {     fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {         if self.fut.is_none() {             let req = self.req.take().unwrap();-             if let Some(client) = &self.client {                 self.fut = Some(client.send(req))             } else {-                let client = Client::new_shared();+                let client = Client::new_shared_or_panic();

It might be too much cfg statements but RequestBuilder would ideally not impl future if there isn't a default.

jbr

comment created time in 6 days

more