Start Debugging

async

40 posts · Page 1 of 4

How to initialize interdependent async singletons at startup in ASP.NET Core

Give each singleton a memoized InitializeAsync that awaits its own dependencies, then await them all from IHostedLifecycleService.StartingAsync. Registration order stops mattering, Kestrel does not accept requests until init finishes, and a failure stops the host. Compared against init before app.Run, IHostedService.StartAsync, and a BackgroundService with a readiness check on ASP.NET Core 10.0.10.
2026-11-05 dartflutterasync

Why does Future.delayed or a Timer fire later than the requested Duration in Dart?

A Dart Timer is a promise never to fire early, not a promise to fire on time. The VM truncates the Duration to whole milliseconds, adds one millisecond on purpose, and delivers the timer as an event that waits behind running code and every pending microtask. Measured lateness on Dart 3.12.2, periodic tick skipping, drift in chained delays, the 4 ms browser clamp, and the 30-day delay that fires instantly on the web.
Next