twitter / util

Wonderful reusable code from Twitter
https://twitter.github.io/util
Apache License 2.0
2.69k stars 583 forks source link

Supporting scala-async #277

Open balthild opened 4 years ago

balthild commented 4 years ago

As mentioned in #93, Future do not supprt scala-async (which introduces the wonderful async/await pattern) because c.t.utils is bound to scala 2.9.2.

Now it's been a while since the library moved to scala 2.12, and I think it's time to reconsider the feature.

Related:

ryanoneill commented 4 years ago

Hi @balthild,

Thanks for revisiting, and interesting timing. Someone else happened to ask about this inside of Twitter within the past week. We are (thankfully) no longer on scala 2.9.2, and are using scala 2.12 inside of Twitter. Right now though for our open source libraries, we're supporting 2.11, 2.12, and trying to get to 2.13 (Finatra's currently blocked there but being worked on).

My expectation is that many of us on the team do feel like it's a better paradigm to program against, and that if we were starting from scratch it would be something we would certainly invest in. Given how far we've come though, I think my main concerns regarding async/await as are follows:

  1. How well would an implementation work with Twitter Futures in terms of ergonomics, correctness, and performance?
  2. What kinds of issues will we run into supporting multiple Scala versions and 2 build systems (sbt / pants*)
  3. What is the compile time cost of the transformations across our entire code base?

@vkostyukov, @mosesn, @roanta, @yufangong, @bryce-anderson - do any of you have thoughts here?

olafurpg commented 4 years ago

I took a stab at integrating Twitter futures with the new async/await support in 2.13.3 (and soon 2.12.12) in the PR #279