Async-std: rename Future::select to Future::race

Created on 31 Oct 2019  路  5Comments  路  Source: async-rs/async-std

Both JS and reactive streams use race for what we call select. So perhaps we should consider following suit.

This is after feedback from @withoutboats that the name may not be right.

api design

Most helpful comment

I like this name Future::race. It's familiar to me, than select.

All 5 comments

I like this name Future::race. It's familiar to me, than select.

I'll update #405 with this change.

While I agree that race is a good name, I would not use familiarity and the JS API as a (final) argument. We should come up with something better.

The reasoning is mainly that this requires the user to have a specific context (either being from the JS world or knowing the specifics of select vs race). We should also somehow make sure that people searching select may also find race.

Related (here I talked about select! but it also applies to select()): https://github.com/rust-lang-nursery/futures-rs/issues/760#issuecomment-522719159

Good counterpoint to mine: https://github.com/rust-lang-nursery/futures-rs/issues/760#issuecomment-532118710

We should also somehow make sure that people searching select may also find race.

I believe we could mention "select" in the docs of race() and then it would pop up when searching for "select" in rustdoc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kornelski picture kornelski  路  5Comments

ghost picture ghost  路  4Comments

zkat picture zkat  路  6Comments

humb1t picture humb1t  路  5Comments

yoshuawuyts picture yoshuawuyts  路  6Comments