StrictConfig class

Strict mode: warnings for code that blocks the server. Use it in development. Dart runs one thing at a time in an isolate, so a slow sync call (bcrypt, a PDF, an image) makes every other request on that isolate wait. When on, Dox writes a [strict] warning to stderr when:

  • the sync part of the middleware and controller of a route takes longer than blockLimit (once per route),
  • the event loop was blocked longer than that, also after an await (at most once in 10 seconds),
  • Hash.make, Hash.verify or Hash.check runs in the web server (once per place in the code). Use Hash.makeAsync or Hash.verifyAsync there.

Off, it costs one bool check per request.

AppConfig(appKey: key, strict: const StrictConfig(enabled: true));

Constructors

StrictConfig({bool enabled = false, Duration blockLimit = defaultBlockLimit})
const

Properties

blockLimit → Duration
Warn when code blocks the isolate longer than this. Default defaultBlockLimit (50 ms). The event loop check does not run more often than every 10 ms, so a smaller limit does not make it faster.
final
enabled → bool
Turn the warnings on. Off by default.
final
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

Constants

defaultBlockLimit → const Duration
The default of blockLimit: 50 ms.