Skip to content

Reverse dependency between services and scheduler #54212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2020

Conversation

goderbauer
Copy link
Member

@goderbauer goderbauer commented Apr 7, 2020

Note to reviewers: This PR contains two commits. The first commit ( 4399765) shows what the world will look like once the migration is done. The second commit on top of that (0089896) is a temporary change that allows us to migrate customers over to the new world. Once all customers are migrated, the second commit will be reverted. I recommend reviewing the commits separately.

Description

This PR reverses the dependency between the services and scheduler layer. Prior to this PR, scheduler was depending on services. With this change it is the other way around: This allows the service layers to schedule tasks via the scheduler layer.

This work is in preparation of #6827: It will allow us to implement the state restoration manager in the service layer (the restoration manage needs access to the task scheduling API of the scheduling layer).

Breaking change: This change is expected to only break people that have custom bindings (rare). In those custom bindings, the order of SchedulerBinding and ServicesBinding will have to be switched around.

Related Issues

Pre-work for #6827.
Supersedes #54211, #54202, and #54151.

Tests

I added the following tests:

  • Modified existing tests to reflect the new dependency chain.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

@fluttergithubbot fluttergithubbot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels. labels Apr 7, 2020
@goderbauer goderbauer changed the title Step0 Reverse dependency between services and scheduler Apr 7, 2020
@@ -6,7 +6,7 @@ import 'dart:async';
import 'dart:convert' show json;
import 'dart:developer' as developer;
import 'dart:io' show exit;
import 'dart:ui' as ui show saveCompilationTrace, Window, window;
import 'dart:ui' as ui show AppLifecycleState, saveCompilationTrace, Window, window;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file will be reverted once customers are migrated.

@goderbauer
Copy link
Member Author

/cc @dnfield @Hixie

@goderbauer goderbauer requested a review from dnfield April 7, 2020 20:00
@goderbauer
Copy link
Member Author

Migration guide has been posted for review: flutter/website#3918

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hixie
Copy link
Contributor

Hixie commented Apr 7, 2020

Seems reasonable.

@fluttergithubbot fluttergithubbot merged commit d47ad7e into flutter:master Apr 8, 2020
@goderbauer goderbauer deleted the step0 branch November 11, 2020 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants