The number of isolates that really run the app. It is the same in
every isolate. Dox sets it when the server starts: from
totalIsolate or config.totalIsolate, and 1 on Windows. It is 1
before that, and in DoxTestClient. Do not change it.
True only in the web server process (startServer() and its
isolates). It is false in bin/queue.dart, the scheduler and tests
that only start providers. A provider can use it to do work only
when the app really serves requests.
Add a global middleware from a package. Call it in the setup() of a
DoxProvider. It runs on every route, before the app's own
globalMiddleware. A second add of the same one is skipped. It takes
the same kinds as globalMiddleware. Use a top-level function or a
const instance, so a restart does not add it twice. The list is
cleared at each start, before the providers run.
Add it from a provider's setup(), which runs on every start.
Anything added before the app starts is cleared.
stop at startup when APP_KEY is missing, not exactly 32
characters, or a public sample key. a short or public key is easy
to guess, so anyone can sign tokens and cookies.
in development, local, test and testing it only logs a warning.
Run task on a worker isolate and give its result, so the server
can answer other requests while it runs. Use it for heavy CPU work:
a PDF, an image, a big JSON file. Tasks run on a small pool of
workers (AppConfig.computeWorkers). More tasks wait in line, first
come first served. An error of the task is thrown here, with its
stack trace.
register the routes of the app routers and give them, without a
server and without providers. dox route:list uses this.
When config.openApi is on, the docs routes are in it too.
Providers do not run, because their setup() may connect to a
database or start a worker. So a route that a provider adds in
setup() is not in the list.
run setup() of every provider, register the routes, then run
boot() of every provider
this is internal core use only
your app do not need to call this function