kotlin协程使用笔记

kotlin使用协程的准备工作

本人使用idea + maven构建项目,使用kotlin + 协程 + 编译项目只需编写一下配置文件即可:

启用协程



        
            org.jetbrains.kotlinx
            kotlinx-coroutines-core
            0.22.2
        

启用maven的kotlin的编译插件


        
            
                org.jetbrains.kotlin
                kotlin-maven-plugin
                ${kotlin.version}
                
                    
                        compile
                        compile
                        
                            compile
                        
                    
                    
                        test-compile
                        test-compile
                        
                            test-compile
                        
                    
                
                
                    1.8
                    enable
                
            
        
    

完成以上工作即可使用在idea上使用kotlin编写和运行kotlin项目了.

你可能感兴趣的:(kotlin协程使用笔记)