Skip to content
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

Live Update Dependencies #93

Open
aikar opened this issue Jan 25, 2018 · 0 comments
Open

Live Update Dependencies #93

aikar opened this issue Jan 25, 2018 · 0 comments
Labels
core Related to the ACF Core

Comments

@aikar
Copy link
Owner

aikar commented Jan 25, 2018

Given:

class A implements Foo {}
class B implements Foo {}

class Command extends BaseCommand {
    @Dependency Foo foo;
}
manager.registerDependency(Foo.class, new A());
BaseCommand command = new Command();
manager.registerCommand(command);
// command.foo == instance of A
// 3 minutes later
manager.registerDependency(Foo.class, new B());
// command.foo should be updated to now be the instance of B

Anytime dependencies are set, re-apply the injection phase and update the dependency to the latest value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the ACF Core
Projects
None yet
Development

No branches or pull requests

2 participants