The one value a single scope has for "wait as long as it takes".
Every timeout parameter of a scope is a Duration?, and all three of its
values were spoken for: absent or null means "take the default from
ScopeConfig", Duration.zero means "expire at once", and any other
Duration is the limit itself. none is the fourth, and it removes the
limit for that one scope — which was possible only for every scope at
once, by setting the matching ScopeConfig.default… to null.
AsyncScope(
waitForChildrenTimeout: ScopeTimeout.none,
disposeScopeTimeout: const Duration(seconds: 5),
…
)
It is accepted by scopeKeyTimeout, disposeScopeTimeout and
waitForChildrenTimeout, on the scopes and on waitForChildren, and by
all four ScopeConfig defaults, where it says for the whole application
what null says there — and not by initCancellationTimeout, which
asserts against it. A cancellation waits for a generator to run out, and a
generator suspended on a future that never completes never does; waiting
for that with no limit is the hang the limit was put there to prevent.
That is a decision for the whole application, so
ScopeConfig.defaultInitCancellationTimeout does take it.
Anywhere else a Duration is asked for it is refused, with an assert:
pauseAfterInitialization is a stretch of time to hold the ready branch
back for rather than a limit on a wait, and "wait as long as it takes" has
nothing to say about one.
It is recognised by its type, so it does not survive being computed
with. ScopeTimeout.none == const Duration(microseconds: -1) is true
and ScopeTimeout.none + Duration.zero is an ordinary Duration: what
comes back from any arithmetic is the negative length behind the marker,
which a timer reads as "expire at once". The package asserts against a
negative limit everywhere it resolves one, so this is loud in debug rather
than silent — but a timeout is a value to pass on, not one to compute
with.
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
-
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