Adds a hosted service with declared dependencies.
Adds a hosted service with an explicit start/stop lifecycle and no dependencies.
Adds a background loop with declared dependencies. A rejection is logged and diagnosed; it does not fail an already-running Application.
Adds a background loop with no dependencies. It starts during activation without blocking activation, but its rejection is observed and shutdown waits for it up to the remaining shared budget.
Records long-lived Application work. Start order is declaration order; stop order is the reverse, and the same injected instances are passed to both. Background loops must observe
context.signal; the Host observes their promise and waits for settlement only within the shared shutdown budget. Non-cooperative work can outlive that budget.The dependency-declaring overload is listed first: overload resolution takes the first match, and the no-dependency shape would otherwise absorb the call and leave the callback parameters untyped.