scalus.cardano.infra

Members list

Type members

Classlikes

trait CancelCheck

Point-in-time cancellation probe. Callers that only need to check "has this been cancelled?" at specific points in their code accept a CancelCheck. Compared to CancelToken, this is a strictly read-only capability — no listener registration and therefore no bookkeeping cost for either side.

Point-in-time cancellation probe. Callers that only need to check "has this been cancelled?" at specific points in their code accept a CancelCheck. Compared to CancelToken, this is a strictly read-only capability — no listener registration and therefore no bookkeeping cost for either side.

API authors SHOULD accept the weakest type they actually honour. An entry guard that only does if cancel.isCancelled then ... should take CancelCheck; an operation that aborts a pending Future mid-wait via a registered listener should take CancelToken. Matching the type to the capability makes the API honest: readers know "will this be observed mid-wait?" by looking at the signature.

Every CancelToken is also a CancelCheck — pass a token where a check is expected; Scala handles the promotion automatically.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait CancelToken
object CancelCheck

Attributes

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

Controlling side of a cancellation. Only the owner of the source has the capability to call cancel; consumers receive the token.

Controlling side of a cancellation. Only the owner of the source has the capability to call cancel; consumers receive the token.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object CancelSource

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
object CancelToken

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait CancelToken extends CancelCheck

Full observable cancellation signal. Extends CancelCheck with onCancel for listener registration — the mechanism implementations use to abort in-flight Futures mid-wait. Consumers receive one of these and can inspect it or register cleanup actions; they cannot trigger cancellation themselves — the CancelSource.cancel capability stays with the scope owner.

Full observable cancellation signal. Extends CancelCheck with onCancel for listener registration — the mechanism implementations use to abort in-flight Futures mid-wait. Consumers receive one of these and can inspect it or register cleanup actions; they cannot trigger cancellation themselves — the CancelSource.cancel capability stays with the scope owner.

Cancellation is how a Future-returning API becomes abortable at all: Future has no cancel of its own, so the capability has to be passed in.

Attributes

Companion
object
Supertypes
trait CancelCheck
class Object
trait Matchable
class Any
object Cancellable

Attributes

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

Handle that undoes a registration.

Handle that undoes a registration.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
final class CancelledException(reason: String, cause: Throwable = ...) extends RuntimeException

Thrown into Futures that were aborted via a CancelToken. The reason describes the cancel site (e.g. "pre-read", "keep-alive beat timeout").

Thrown into Futures that were aborted via a CancelToken. The reason describes the cancel site (e.g. "pre-read", "keep-alive beat timeout").

Attributes

Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class ResyncRequiredException(message: String) extends RuntimeException

The chain rolled back further than the provider's rollback horizon, so the events needed to reconcile the subscriber's view are no longer available. The consumer must resubscribe, and generally re-seed from a snapshot.

The chain rolled back further than the provider's rollback horizon, so the events needed to reconcile the subscriber's view are no longer available. The consumer must resubscribe, and generally re-seed from a snapshot.

Attributes

Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class ScalusBufferOverflowException(message: String) extends RuntimeException

A bounded delta buffer overflowed. The subscriber's view of chain state is no longer trustworthy: events were produced faster than they were consumed, and dropping them silently would corrupt derived state. The subscription is terminated so the consumer resyncs.

A bounded delta buffer overflowed. The subscriber's view of chain state is no longer trustworthy: events were produced faster than they were consumed, and dropping them silently would corrupt derived state. The subscription is terminated so the consumer resyncs.

Attributes

Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class UnsupportedSubscriptionException(val reason: String) extends RuntimeException

Exceptions raised by streaming subscriptions.

Exceptions raised by streaming subscriptions.

Two channels, deliberately distinct:

  • UnsupportedSubscriptionException is an argument error. It is thrown synchronously from subscribeXxx, at the call site that caused it, before any registration happens.
  • The others are runtime failures. They surface through the stream's failure channel — a failed Future from ScalusAsyncSource.pull() — because by then the subscription exists and the caller is consuming it.

Attributes

Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all