I'm not sure if there's a guaranteed order of which Future will complete first, toList() or controller.close(). It might be safer to wait on both with Future.wait