Skip to content

Live Update Dependencies #93

@aikar

Description

@aikar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreRelated to the ACF Core

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions