Handles cancellation of prior running requests, in case a new one is incoming.
Handles cancellation of prior running requests, in case a new one is incoming.
This only applies if asyncOpt returns non-empty results, meaning B is asynchronously calculated,
and that this calculation can be stopped. If a new request arrives, CancellableFuture.cancel is
called on previous requests that are still running.
final case classCancellableFuture[+T](future: Future[T], cancel: () ⇒ Unit) extends Product with Serializable
Handles cancellation of prior running requests, in case a new one is incoming.
This only applies if
asyncOpt
returns non-empty results, meaning B is asynchronously calculated, and that this calculation can be stopped. If a new request arrives, CancellableFuture.cancel is called on previous requests that are still running.