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
add option not to start any threads #10
Comments
Or just provide an option to disable individual classes from being initialized in StaticComponentContainer that spawn threads (fields for these components will stay null). If user wants to use threads, he has to initialize his own ComponentContainer.
does not work as well because any instance of Modules initializes the StaticComponentContainer. |
Sorry but except for the task monitoring thread which can be closed by calling |
Or maybe make the functionality of |
I will work to make possible to disable the autostart of these threads from the configuration file. When I'll finish I will answer here: stay tuned |
Solved with the introduction of the deferred initialization of the BackgroundExecutor in the version just released (10.0.0): now the threads are started only when the library or developer creates tasks via the BackgroundExecutor. You need also to add these properties to your burningwave.static.properties file: priority-of-this-configuration-file=1
background-executor.all-tasks-monitoring.enabled=false
modules.export-all-to-all=false
static-component-container.on-close.close-all-component-containers=false
static-component-container.on-close.close-file-system-helper=false I wait your feedback |
Off Topic
Thus the library is good for one off tasks, but to repetitively call the same method/field accessor it is better to reduce the overhead as much as possible. Anyhow, great work with the significant JVM hacks! Adding add-opens during development/testing is quite bothersome. |
Burningwave Core caches the collection of the member retrieved through reflection and the cache can also be cleared, for the problem of multiple burningwave.static.properties file you can solve through the new property Thanks for the feedback! |
I guess the priority is a fine solution. Thanks for clarifying. Initializing an iterator on each access is still an allocation on the path of a simple call. |
Do you suggest using array then? |
I think the internal storage would not matter much as long as the user is able to lookup the methodhandle/box, store that in a variable and use that for calling afterwards (without any more allocations, lookups, hashcode calculations). |
please provide an option to disable startup of any threads:
I am using:
And afterwards there is no way to shutdown all threads. I don't see an option to prevent the threads from being started as well. Maybe start the threads lazy the first time when a BackgroundExecutor call is made? Or provide a BackgroundExecutor implementation that directly invokes runnables instead of delegating to threads. Or allow someone to provide his own implementation for the BackgroundExecutor that works without threads. Same applies to FileSystemHelper.
The text was updated successfully, but these errors were encountered: