aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/configuration.kt
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat@beresnev.me>2022-02-14 10:48:38 +0300
committerGitHub <noreply@github.com>2022-02-14 10:48:38 +0300
commita43e11e08d57bd898efc72d6db94ed3d4b01f74f (patch)
tree5949ef8a2c26c5b65a64ad4b777081860deec6d9 /core/src/main/kotlin/configuration.kt
parent019cef47f1bf993a7a25ec73e88b1d9da25528eb (diff)
downloaddokka-a43e11e08d57bd898efc72d6db94ed3d4b01f74f.tar.gz
dokka-a43e11e08d57bd898efc72d6db94ed3d4b01f74f.tar.bz2
dokka-a43e11e08d57bd898efc72d6db94ed3d4b01f74f.zip
Shutdown coroutines dispatchers after each module pass (#2325)
* Update kotlinx.coroutines to 1.6.0 * Shutdown common coroutines dispatchers after each module pass * Don't finalize coroutines in unit tests Co-authored-by: Mikhail Zarechenskiy <mikhail.zarechenskiy@jetbrains.com>
Diffstat (limited to 'core/src/main/kotlin/configuration.kt')
-rw-r--r--core/src/main/kotlin/configuration.kt19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt
index 038a5bb7..ebd6ed61 100644
--- a/core/src/main/kotlin/configuration.kt
+++ b/core/src/main/kotlin/configuration.kt
@@ -134,6 +134,25 @@ interface DokkaConfiguration : Serializable {
val includes: Set<File>
val suppressInheritedMembers: Boolean
+ /**
+ * Whether coroutines dispatchers should be shutdown after
+ * generating documentation via [DokkaGenerator.generate].
+ *
+ * It effectively stops all background threads associated with
+ * coroutines in order to make classes unloadable by the JVM,
+ * and rejects all new tasks with [RejectedExecutionException]
+ *
+ * This is primarily useful for multi-module builds where coroutines
+ * can be shut down after each module's partial task to avoid
+ * possible memory leaks.
+ *
+ * However, this can lead to problems in specific lifecycles where
+ * coroutines are shared and will be reused after documentation generation,
+ * and closing it down will leave the build in an inoperable state.
+ * One such example is unit tests, for which finalization should be disabled.
+ */
+ val finalizeCoroutines: Boolean
+
enum class SerializationFormat : Serializable {
JSON, XML
}