Closed bioform closed 9 months ago
There are number of possible approaches here, but it depends what your desired goal and usage pattern is (e.g. multiple uses of a plugin instance within the same DSL parse through to having Lite reuse plugin instances until shutdown). If you're calling an external data source inside the plugin, you might want to consider caching that information to disk (next to the workspace.dsl
file) as another viable alternative to avoiding any longer running tasks each time the DSL is reloaded.
No response ... closing as stale.
Description
Each time we request the DSL file rendering, the
structurizr
creates a new class loader and constructs a new plugin instance. At the same time, the plugin initialization can take some time (for example to authenticate on third-party services).So there is no possibility for caching any kind of information between the rendering requests (for example when using Structurizr Lite).
It would be good to have a kind of API(maybe an
Interface
that the plugin can implement), to let the engine know to cache the plugin instance.WDYT?
Priority
I'm willing to add this feature myself and raise a PR (please confirm approach first)
More information
No response