Future<T> run<T>(Future<T> Function() action) { final previous = _last; final done = Completer<void>(); _last = done.future; return previous.then((_) => action()).whenComplete(done.complete); }