aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/me/bush/illnamethislater/Config.kt
blob: 31c2b63e411ae7b8385768aaf80e4e15f1750915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package me.bush.illnamethislater

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import kotlin.coroutines.CoroutineContext


/**
 * A class containing configuration options for an [EventBus].
 *
 * [Information and examples](https://github.com/therealbush/eventbus-kotlin#tododothething)
 *
 * @author bush
 * @since 1.0.0
 */
data class Config(

    /**
     * The logger this [EventBus] will use to log errors, or log [EventBus.debugInfo]
     */
    val logger: Logger = LogManager.getLogger("Eventbus"),

    /**
     * The [CoroutineContext] to use when posting events to parallel listeners. The default
     * value will work just fine, but you can specify a custom context if desired.
     *
     * [What is a Coroutine Context?](https://kotlinlang.org/docs/coroutine-context-and-dispatchers.html)
     *
     * [Information and examples](https://github.com/therealbush/eventbus-kotlin#tododothething)
     */
    val parallelScope: CoroutineScope = CoroutineScope(Dispatchers.Default),

    /**
     * Whether this [EventBus] should try to find a "cancelled" field in events being listened for that
     * are not a subclass of [Event]. This is experimental, and should be set to `false` if problems arise.
     *
     * [Information and examples](https://github.com/therealbush/eventbus-kotlin#tododothething)
     */
    val thirdPartyCompatibility: Boolean = true,

    /**
     * todo doc
     */
    val annotationRequired: Boolean = false
)