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

PluginBootstrapper.Bootstrap event called on each Http Get Request #45

Open
avatejo opened this issue Mar 19, 2021 · 2 comments
Open

PluginBootstrapper.Bootstrap event called on each Http Get Request #45

avatejo opened this issue Mar 19, 2021 · 2 comments

Comments

@avatejo
Copy link

avatejo commented Mar 19, 2021

I'm using Prise in a dotnetCore3.1 windows service, that does plugin discovery in the ApplicationLifetime.ApplicationStarted Event to add new Web Controllers at runtime.

Everything works fine !, I'm able to invoke Web Modules Methods, access Host Configuration using the Proxy, and invoke Services registered by the Bootstrapper of each Controller.

I use an Interface to allow Prise discover the module on the ApplicationStarted Event : IWebModule

Later when perform a Http Get request to any Controller method (I have three controllers and three bootstrapper classes), the Bootstrapper event is called.

But then after continuous request, the Bootstrapper event and all services are been loaded again and again.
This seems to me like a performance issue. :(

How can I preserve the scoped ServiceCollection and use the same one over the calls?, there is some singleton services and all other are scoped services.

I would like to: when load the plugin, load the service collection and later be able to access some singleton services inside the Scoped service collection.

I'm developing a Health Check system to monitor the Web Module Status, that is perform getting some data from singleton services running inside the Web Module.

@merken
Copy link
Owner

merken commented Mar 19, 2021

Hi,

Nice to hear that it is you've managed to setup Prise.

Sounds like a lifecycle issue to me, would you mind sharing a reproduction example via a GitHub repo?

Kr,
M

@merken
Copy link
Owner

merken commented Oct 4, 2022

Hi,

I still need a reproduction repo to investigate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants