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

Runtime Dependency Registering #122

Open
BitByLogics opened this issue Dec 31, 2024 · 1 comment
Open

Runtime Dependency Registering #122

BitByLogics opened this issue Dec 31, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@BitByLogics
Copy link

Essentially allowing a method for registering dependencies after Lamp is already built using the builder. I'm trying to hook my own dependency manager into Lamp so dependencies are registered to both when registered with my system.

@BitByLogics BitByLogics added the enhancement New feature or request label Dec 31, 2024
@Revxrsal
Copy link
Owner

Revxrsal commented Dec 31, 2024

You can register a Supplier as a dependency. You could make it return a field, or throw an exception if it's not ready to be used yet.

private Something something;
...
builder.dependency(Something.class, () -> {
	if (something == null)
		throw new IllegalArgumentException("Something is not ready yet.").
	return something;
});

EDIT: I see you have your own dependency system. I'll see if there's a way to enable dependencies after building

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants