Top "Future" questions

A placeholder for the result of a calculation before the calculation has completed.

Map a Future for both Success and Failure

I have a Future[T] and I want to map the result, on both success and failure. Eg, something like …

scala future
ExecutorService.submit(Task) vs CompletableFuture.supplyAsync(Task, Executor)

To run some stuff in parallel or asynchronously I can use either an ExecutorService: <T> Future<T&…

java concurrency future completable-future
Asynchronous IO in Scala with futures

Let's say I'm getting a (potentially big) list of images to download from some URLs. I'm using Scala, so what …

multithreading scala io future
Futures - map vs flatmap

I've read the docs about map and flatMap and I understand that flatMap is used for an operation that accepts …

scala future
Map the Exception of a failed Future

What's the cleanest way to map the Exception of a failed Future in scala? Say I have: import scala.concurrent._ …

scala akka future scala-2.10
Scala - ScheduledFuture

I am trying to implement scheduled future in Scala. I would like it to wait specific time and then execute …

scala future
Future[Option] in Scala for-comprehensions

I have two functions which return Futures. I'm trying to feed a modified result from first function into the other …

scala future for-comprehension
Combine awaitables like Promise.all

In asynchronous JavaScript, it is easy to run tasks in parallel and wait for all of them to complete using …

python python-3.x async-await future python-asyncio
Future with Timeout in Scala

Suppose I have a function, which invokes a blocking interruptible operation. I would like to run it asynchronously with a …

scala concurrency future
Confusion about threads launched by std::async with std::launch::async parameter

I am a little bit confused about the std::async function. The specification says: asynchronous operation being executed "as if …

c++ multithreading c++11 future stdthread