D4rtExecutionHooks class
What a run's hooks are. Given per call (hooks:); a runner may hold a
default (executionHooks).
Constructors
-
D4rtExecutionHooks({void onStart(D4rtExecutionContext context)?, void onImport(D4rtExecutionContext context, Uri library)?, D4rtEntryHook? onEntry, D4rtEntryHook? onNativeEntry, void onTask(D4rtExecutionContext context, D4rtTask task)?, void onError(D4rtExecutionContext context, Object error, StackTrace stackTrace)?, void onEnd(D4rtExecutionContext context, D4rtExecutionOutcome outcome)?, void onRevoked(D4rtExecutionContext context, Object? reason)?, void onDrained(D4rtExecutionContext context)?, D4rtTracking tracking = D4rtTracking.entriesOnly, Set<
Permission> ? permissions, D4rtOutput? output, ZoneSpecification? zoneSpecification, Map<Object?, Object?> ? zoneValues}) -
const
- D4rtExecutionHooks.trackingOnly(D4rtTracking tracking)
-
Hooks that only count: no callbacks, the given
tracking.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onDrained → void Function(D4rtExecutionContext context)?
-
Each time the run becomes drained; the last time once it is revoked.
final
- onEnd → void Function(D4rtExecutionContext context, D4rtExecutionOutcome outcome)?
-
Once, when the run has ended: the entry function's result is available
(an async entry function: its Future settled).
final
- onEntry → D4rtEntryHook?
-
Around EVERY entry, nested ones included (D4rtEntry.isNested).
final
- onError → void Function(D4rtExecutionContext context, Object error, StackTrace stackTrace)?
-
An uncaught error of this run. The runner-wide
onUncaughtErrorstays the fallback for runs without it.final - onImport → void Function(D4rtExecutionContext context, Uri library)?
-
Before a library is loaded for this run (the entry library's imports and
theirs), once per library. Throw to refuse it; the run fails there.
final
- onNativeEntry → D4rtEntryHook?
-
Around native entries only (never nested ones); runs inside onEntry
when both are set.
final
- onRevoked → void Function(D4rtExecutionContext context, Object? reason)?
-
When
revoke()was called (new entries are refused by then); a second time with a D4rtGraceExpired reason when a revoke grace has elapsed.final - onStart → void Function(D4rtExecutionContext context)?
-
Before imports, initializers and the entry function. Throw to refuse the
run: the execute method then throws D4rtExecutionRejectedException.
final
- onTask → void Function(D4rtExecutionContext context, D4rtTask task)?
-
A timer, periodic timer or microtask the run schedules, when tracking
observes that kind.
final
- output → D4rtOutput?
-
Where this run's
printand stdout / stderr go; null: as without hooks.final -
permissions
→ Set<
Permission> ? -
This run's permissions; null: the runner's. The runner's set is the
ceiling: the effective set is this set intersected with the runner's.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tracking → D4rtTracking
-
What drain counts and what revoke does with scheduled work.
final
- zoneSpecification → ZoneSpecification?
-
The run's execution Zone is forked from the caller's Zone with these.
final
-
zoneSpecifications
→ List<
ZoneSpecification> -
The Zone specifications the execution Zone is forked through, outermost
first (one, or several after merge).
no setter
-
zoneValues
→ Map<
Object?, Object?> ? -
final
Methods
-
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
Static Methods
-
merge(
List< D4rtExecutionHooks> hooks) → D4rtExecutionHooks - Combines hook sets, e.g. a tracking helper and the application's own.