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

Lazy Load Command Handlers #78

Open
robinmanuelthiel opened this issue Jan 16, 2024 · 1 comment
Open

Lazy Load Command Handlers #78

robinmanuelthiel opened this issue Jan 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@robinmanuelthiel
Copy link
Member

robinmanuelthiel commented Jan 16, 2024

Currently, the ScheduledCommandRunner instantiates all Command Handlers, independent of if it is used at all. This should only be needed, when a command is actually getting processed, so we should lazy load the Handlers.

This can become a problem, when all Command Handlers of a project across multiple micro-services are shared in one assembly, which can lead to Command Handlers being loaded, that have dependencies to stuff that is not available in the current context.

@robinmanuelthiel robinmanuelthiel added the bug Something isn't working label Jan 16, 2024
@robinmanuelthiel
Copy link
Member Author

I vote for explicitly defining the command handlers that should be loaded in the DI (even lazy) because I only catch lazy loaded dependencies that cannot be resolved in the dependency chain at runtime...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants