lampepfl / gears

A strawman for a low-level async library in Scala 3.
https://lampepfl.github.io/gears/
Apache License 2.0
256 stars 26 forks source link

Add `Future.resolved / rejected / completed` as shortcuts for `Future.now` #45

Closed natsukagami closed 8 months ago

natsukagami commented 9 months ago

Might also be thinking about naming here:

He-Pin commented 9 months ago

Cool, But I have a question,it will cause some inconvenient when user use gear's Future and the current Future in Scala's stdlib? What's the plan for this?

natsukagami commented 9 months ago

Cool, But I have a question,it will cause some inconvenient when user use gear's Future and the current Future in Scala's stdlib? What's the plan for this?

@He-Pin You can probably easily convert a Scala stdlib Future into a gears Future. Going the other way shouldn't be too difficult but I will have to look into it.

m8nmueller commented 8 months ago

I have a slight personal preference for resolved/rejected because the participle indicates grammatically that an action from the lifecycle of a Future (to complete) is already taken. Either way, it's a nice thing to have.