• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 package kotlinx.coroutines.internal
6 
7 import kotlinx.coroutines.*
8 
9 /** @suppress */
10 @InternalCoroutinesApi // Emulating DI for Kotlin object's
11 public interface MainDispatcherFactory {
12     public val loadPriority: Int // higher priority wins
13 
14     /**
15      * Creates the main dispatcher. [allFactories] parameter contains all factories found by service loader.
16      * This method is not guaranteed to be idempotent.
17      */
createDispatchernull18     public fun createDispatcher(allFactories: List<MainDispatcherFactory>): MainCoroutineDispatcher
19 
20     /**
21      * Hint used along with error message when the factory failed to create a dispatcher.
22      */
23     public fun hintOnError(): String? = null
24 }
25