merken / Prise

A .NET Plugin Framework.
https://merken.github.io/Prise
MIT License
361 stars 39 forks source link

[Question] From the Host Web API's perspective: Is there a way to limit max execution time of a plugin? #68

Open sameer-yadav-gep opened 1 year ago

sameer-yadav-gep commented 1 year ago

I have a scenario where the Base plugin contract can be implemented in multiple ways for different use cases. All the plugin implementations are loaded into the Host app in different Assembly Load Contexts. Since the host app doesn't have control over the code written into the plugins, how can it terminate a plugin execution if it's taking longer than a specific timespan?

I have tried using cancellation token as an argument to the methods specified in the base plugin interface, but it's the responsibility of the implementation to co-operate with the cancellation. Is there a way to enforce termination from the host app/ calling method?