Technical considerations
We made some opinionated choices on Thoth return types/
-
The java
CompletionStageis used for async call but there is wrappers that exposesMonofor spring integration. -
The reactive stream
Publisheris used for stream processing and akkaSourceand springFluxcan be used in modules. -
The vavr
Eitheris used to handle business errors. The idea is to have three channels:- it’s ok:
CompletionStage(Right("Result")) - it’s an error:
CompletionStage(Left("Bad request")) - it’s a failure:
CompletionStage.failed(CrashedException("Crap!"))
- it’s ok:
-
io.vavr.Tuple0is used instead ofvoidso everything can be an expression:Tuple0 sideEffect() { println("I have done a side effect"); return Tuple.empty(); }