scala/airframe
-
airframe-control: Parallelscala/airframe 2023. 7. 6. 16:39
airframe-control 의 Parallel 을 테스트 해 본다. 코드 import wvlet.airframe.control.Parallel import java.text.SimpleDateFormat import java.util.Date object AirframeParallel { def now(): String = { val pattern = "HH:mm:ss.SSSZ" val simpleDateFormat = new SimpleDateFormat(pattern) simpleDateFormat.format(new Date()) } def main(args: Array[String]): Unit = { val source: Seq[Int] = Seq(1, 2, 3, 4, 5) println(s..
-
airframe-di: Dependency Injectionscala/airframe 2022. 11. 19. 22:42
airframe-di 를 이용한 Dependency Injection maven repo: https://mvnrepository.com/artifact/org.wvlet.airframe/airframe 아래정도 기능만 사용하는 것이 좋을 것 같다. https://wvlet.org/airframe/docs/airframe-di#child-sessions 등을 사용하면 테스트나 코드 읽기가 힘들어질 것 같다. Note: +(add) operator 로 design 을 합치거나 override(lazy) 할 수 있다. lazy 하게 적용되기 때문에, 필요한 components 를 나중에 +(add) operator 로 제공되어도 괜찮다. bind[T].toProvider(...) 이것 덕분에 복잡할 수 있는..