├── README.md ├── diagram.png └── diagram.pu /README.md: -------------------------------------------------------------------------------- 1 | # kotlin-coroutines-class-diagram 2 | 3 | ![diagram](./diagram.png) 4 | -------------------------------------------------------------------------------- /diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takahirom/kotlin-coroutines-class-diagram/c5e131b6efe5f5f3eab65023fab4b8be35311fe5/diagram.png -------------------------------------------------------------------------------- /diagram.pu: -------------------------------------------------------------------------------- 1 | @startuml 2 | 3 | interface CoroutineContext{ 4 | public CoroutineContext plus(CoroutineContext) 5 | } 6 | 7 | interface Element { 8 | public Key key 9 | } 10 | CoroutineContext <|.. Element 11 | 12 | class AbstractCoroutineContextElement extends Element 13 | 14 | interface ContinuationInterceptor 15 | 16 | class CoroutineDispatcher extends AbstractCoroutineContextElement{ 17 | } 18 | 19 | ContinuationInterceptor <|.. CoroutineDispatcher 20 | 21 | class ExecutorCoroutineDispatcher extends CoroutineDispatcher{ 22 | } 23 | 24 | class ExperimentalCoroutineDispatcher extends ExecutorCoroutineDispatcher{ 25 | 26 | } 27 | class DefaultScheduler extends ExperimentalCoroutineDispatcher{ 28 | } 29 | 30 | class LimitingDispatcher extends ExperimentalCoroutineDispatcher{ 31 | } 32 | 33 | Element <|.. Job 34 | 35 | 36 | interface Job{ 37 | } 38 | interface ChildJob{ 39 | } 40 | interface ParentJob{ 41 | } 42 | interface SelectClause0{ 43 | } 44 | class JobSupport{ 45 | } 46 | Job <|.. JobSupport 47 | Job <|.. ChildJob 48 | Job <|.. ParentJob 49 | ChildJob <|.. JobSupport 50 | ParentJob <|.. JobSupport 51 | SelectClause0 <|.. JobSupport 52 | class JobImpl extends JobSupport{ 53 | } 54 | 55 | interface CoroutineScope 56 | 57 | class GlobalScope { 58 | } 59 | CoroutineScope <|.. GlobalScope 60 | 61 | CoroutineScope *- CoroutineContext 62 | 63 | class CombinedContext extends CoroutineContext{ 64 | CoroutineContext left 65 | Element element 66 | } 67 | 68 | CombinedContext *-- CoroutineContext 69 | CombinedContext *- Element 70 | 71 | class AbstractCoroutine extends JobSupport{ 72 | } 73 | class StandaloneCoroutine extends AbstractCoroutine{ 74 | } 75 | interface Deferred 76 | interface SelectClause1 77 | 78 | Job <|.. AbstractCoroutine 79 | Continuation <|.. AbstractCoroutine 80 | CoroutineScope <|.. AbstractCoroutine 81 | CoroutineContext <|.. EmptyCoroutineContext 82 | Job <|.. Deferred 83 | 84 | class DeferredCoroutine extends AbstractCoroutine{ 85 | } 86 | 87 | Deferred <|.. DeferredCoroutine 88 | SelectClause1 <|.. DeferredCoroutine 89 | 90 | note bottom of JobImpl : Job() 91 | note bottom of DeferredCoroutine : async{} 92 | note bottom of StandaloneCoroutine : launch{} 93 | note bottom of DefaultScheduler : Dispatchers.Default 94 | note bottom of LimitingDispatcher : Dispatchers.IO 95 | 96 | @enduml 97 | --------------------------------------------------------------------------------