kotlin ee
play

Kotlin EE Boost Your Productivity Marcus Fihlon @McPringle - PowerPoint PPT Presentation

Kotlin EE Boost Your Productivity Marcus Fihlon @McPringle fun main( args : Array<String>) { val event =


  1. Kotlin EE Boost Your Productivity Marcus Fihlon @McPringle

  2. ● ● ● ● ● ●

  3. ● ● ● ● ● ●

  4. ● ● ● ● ●

  5. ● ● ● ● ● ● ● ●

  6. fun main( args : Array<String>) { val event = "KotlinConf" println ( "Hi $ event !" ) }

  7. class Person( val name : String, val age : Int, val company : String?) { … }

  8. open class Person( val name : String, val age : Int, val company : String?) { … }

  9. data class Person( val name : String, val age : Int, val company : String?) val marcus = Person( "Marcus" , 29, null ) println ( marcus ) // Person(name=Marcus, age=43, company=null) val marcusCSS = marcus .copy(company = "CSS Insurance" ) println ( marcusCSS ) // Person(name=Marcus, age=43, company=CSS Insurance)

  10. object PersonController { val persons = mutableListOf <Person>() fun save( person : Person) { persons .add( person ) } … }

  11. fun main( args : Array<String>): Unit = runBlocking { val jobs = List (10) { async (CommonPool) { PriceService(). price } } println ( jobs . sumBy { it .await() } / 10) }

  12. val page = html { head { title { "My Website" } } body { p { "Hello KotlinConf!" } } }

  13. ● ● ● ● ● ● ● ● ● ● ● ● ● ● dependencies { providedCompile "javax:javaee-api: $javaee_version " }

  14. FROM payara / micro COPY myapplication.war / opt / payara / deployments

  15. buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-allopen: $kotlin_version " } } allOpen { annotation( 'javax.ejb.Stateless' ) annotation( 'javax.ws.rs.Path' ) }

  16. buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-noarg: $kotlin_version " } } noArg { annotation( 'javax.ws.rs.Path' ) }

  17. ● docker-machine ls ● docker-machine create -d virtualbox mgr ● docker-machine create -d virtualbox node01 ● docker-machine ssh mgr ● docker swarm init --advertise-addr 192.168.99.100

  18. ● docker run -it -d -p 8080:8080 -e HOST=192.168.99.100 \ -v /var/run/docker.sock:/var/run/docker.sock \ --name visualizer dockersamples/visualizer ● http://192.168.99.100:8080/

  19. ● docker swarm join-token worker ● docker-machine ssh node01 ● docker swarm join --token <token> 192.168.99.100:2377

  20. ● docker-machine ssh mgr ● docker node ls ● docker info

  21. ● docker-machine ssh mgr ● docker network create -d overlay kotlinconf ● docker network ls

  22. ● docker-machine ssh mgr ● docker service create --network kotlinconf \ --name timeservice mcpringle/timeservice ● docker service create --network kotlinconf -p 8181:8080 \ --name helloservice mcpringle/helloservice ● docker service ls

  23. ● http http://192.168.99.100:8181/api/hello/kotlinconf ● docker service update --replicas 3 helloservice ● docker node update --availability drain mgr ● docker node update --availability active mgr

  24. ● ● ● ●

  25. ● ● ● ● ● ● ● ● ● ● ● ● ● ●

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend