Made coroutineDispatcher configurable

This commit is contained in:
dankito 2024-11-26 03:38:35 +01:00
parent 72991218d9
commit c3cf0652b2
1 changed files with 2 additions and 3 deletions

View File

@ -23,7 +23,8 @@ import java.util.concurrent.Executors
import kotlin.math.max import kotlin.math.max
open class EmailsFetcher( open class EmailsFetcher(
protected open val eInvoiceReader: EInvoiceReader = EInvoiceReader() protected open val eInvoiceReader: EInvoiceReader = EInvoiceReader(),
protected open val coroutineDispatcher: CoroutineDispatcher = Executors.newFixedThreadPool(max(24, Runtime.getRuntime().availableProcessors() * 4)).asCoroutineDispatcher()
) { ) {
protected data class MessagePart( protected data class MessagePart(
@ -32,8 +33,6 @@ open class EmailsFetcher(
) )
protected open val coroutineDispatcher = Executors.newFixedThreadPool(max(24, Runtime.getRuntime().availableProcessors() * 4)).asCoroutineDispatcher()
protected val log by logger() protected val log by logger()