aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/MultithreadingDSL.kt
blob: 101bb1f32f2ddb63746fe726c382593af15abf15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package cc.polyfrost.oneconfig.utils.dsl

import cc.polyfrost.oneconfig.utils.Multithreading
import java.util.concurrent.TimeUnit

/**
 * Runs the given [block] asynchronously.
 *
 * @see Multithreading.runAsync
 */
fun runAsync(block: () -> Unit) = Multithreading.runAsync(block)

/**
 * Runs the given [block] asynchronously after the given [delay].
 *
 * @see Multithreading.schedule
 */
fun schedule(delay: Long, timeUnit: TimeUnit, block: () -> Unit) = Multithreading.schedule(block, delay, timeUnit)