CancelSource

scalus.cardano.infra.CancelSource
See theCancelSource companion trait
object CancelSource

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(logger: Logger = ...): CancelSource

Fresh, unlinked source. logger is used to record listener exceptions alongside propagation — see CancelToken.onCancel's listener contract.

Fresh, unlinked source. logger is used to record listener exceptions alongside propagation — see CancelToken.onCancel's listener contract.

Attributes

def linkedTo(parent: CancelToken, logger: Logger = ...): CancelSource

Linked source: cancelling parent cancels this one too (and carries the parent's cause through). Cancelling this source does NOT cancel the parent — scope isolation is downward-only.

Linked source: cancelling parent cancels this one too (and carries the parent's cause through). Cancelling this source does NOT cancel the parent — scope isolation is downward-only.

If parent is already cancelled, the returned source is cancelled immediately with the parent's cause.

The link is symmetric about cleanup: on child cancel (for any reason), the child deregisters from the parent's listener list so a long-lived parent doesn't accumulate stale closures from short-lived children.

Attributes

Concrete fields

val DefaultReason: String

Default reason string used when a source is cancelled without an explicit cause.

Default reason string used when a source is cancelled without an explicit cause.

Attributes

val ParentCancelledReason: String

Reason used on linked children when the parent fires and did not store a cause.

Reason used on linked children when the parent fires and did not store a cause.

Attributes