Handle returned by Async.start (via Async.Running) that stops a running Async.
Calling cancel() is idempotent and synchronous. It prevents a terminal value from being published if cancellation linearizes before the run reaches completion, and it is a no-op once the run has completed.
When cancellation wins, the driver also signals Pollable.cancel on the active pending operation. A source that can abort an in-flight socket read, timer, or callback registration implements that hook; the default hook is a no-op. Cancellation does not wait for an already-running Pollable.poll invocation to return.
Extends java.lang.AutoCloseable so a Async.Running handle can be used as a managed resource (scala.util.Using, Java try-with-resources): close simply delegates to cancel(). cancel remains the canonical verb — it names the domain operation (stop an in-flight computation) and, unlike AutoCloseable.close, declares no checked exception.
Attributes
- Companion
- object
- Source
- Cancelable.scala
- Graph
-
- Supertypes
- Known subtypes
-
class Running[A]class AsyncSelector[A]