InfoQ Homepage Presentations Simplifying Asynchronous Code With Scala Async
Simplifying Asynchronous Code With Scala Async
Summary
Philipp Haller introduces Scala Async for asynchronous I/O with Futures and Promises.
Bio
Philipp Haller has been a member of the Scala team since 2006. His research on concurrent programming with race-free actors in Scala has been published in leading conferences, winning a best paper award. He is the creator of Scala’s first actors library which inspired Akka, as well as a contributor to the Scala language, standard library, and tools. He holds a PhD in Computer Science from EPFL.
About the conference
Strange Loop is a multi-disciplinary conference that aims to bring together the developers and thinkers building tomorrow's technology in fields such as emerging languages, alternative databases, concurrency, distributed systems, mobile development, and the web.
Community comments
Too restrictive but works nice in simple cases
by Alexander Semenov,
Too restrictive but works nice in simple cases
by Alexander Semenov,
Your message is awaiting moderation. Thank you for participating in the discussion.
Unfortunately, this approach is too limiting. If you have a bunch of calls returning futures of Option, Either, Validation, or similar, and have to use one call result in next call - you're out of luck. You can't do usual for comprehension business on these types since they involve creating inner lambdas when unsugared to map/flatMap and the restriction is not to use await within lambdas. So you're thrown to using pattern matching (which annihilates any benefit from async/await, in my opinion).