aikar / aikar/commands

Live Update Dependencies

Open
#93 0 comments 0 reactions 0 assignees View on GitHub
core
Dominant language
Java
Stars
628
Forks
150
PR merge metrics
No merged PRs in 30d

Description

Given:
```java
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.