ZenithDrainable class abstract

Abstraction for objects that can perform bounded-time cleanup work before a tenant scope is finally destroyed.

Register instances via ZenithTenantScope.registerDrainable. When ZenithScopeManager.endScopeAsync is called, all drainables are awaited (with a bounded timeout) before the scope container is disposed.

Typical use-cases:

  • Flushing a pending SQLite write transaction.
  • Completing an in-flight HTTP mutation from the outbox.
  • Persisting unsaved user preferences to disk.
Implementers

Constructors

ZenithDrainable()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

drain() → Future<void>
Performs the cleanup/flush work.
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