DVContext class

The context handed to a DV.transaction body and to backend functions.

A backend function whose first parameter is a DVContext receives it by injection; it is not a client-supplied argument.

Constructors

DVContext({DVMutableLifecycleSignal<DVTransactionLifecycle>? transactionLifecycle, DVMutableLifecycleSignal<DVRequestLifecycle>? requestLifecycle, DVMutableLifecycleSignal<DVPageLifecycle>? pageLifecycle, DVContext? parent, DVSessionPrincipal? session, DVApiPrincipal? apiPrincipal})

Properties

apiPrincipal → DVApiPrincipal?
The third-party caller the request authenticated with an API key or an OAuth token, or null.
final
hashCode → int
The hash code for this object.
no setterinherited
isNested → bool
Whether this context is nested inside another transaction.
no setter
lifecycle → DVContextLifecycle
Lifecycle signals scoped to this context.
final
pendingAfterCommit → List<FutureOr<void> Function()>
Registered after-commit callbacks, in registration order.
no setter
pendingCompensations → List<FutureOr<void> Function()>
Registered compensations, in registration order.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
session → DVSessionPrincipal?
The signed-in person the request authenticated with the application's own session, or null.
final
transactionId → String
The identifier of the unit of work this context belongs to.
no setter
user → Object?
The application's user the session resolved to on this request, or null for a request with no session or an application that resolves no user.
no setter

Methods

afterCommit(FutureOr<void> callback()) → void
Registers work to run only after the transaction commits.
compensate(FutureOr<void> callback()) → void
Registers the inverse of an external effect that Dartvel cannot reverse on its own — refunding a charge, deleting a remote record.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited