Hey jimm, thanks for the in-depth response.
I’m on Scala, so it sounds like your experience is applicable to me. It looks like I might have an easier time of it since I do everything in one shot (eg. Future(foo).onSuccess(bar)) instead of mapping and flatmapping a number of smaller monads together, meaning I shouldn’t have an issue with multiple transactions.
So yes, it would be great to see how you implemented it - if you and your employer don’t mind it.
BTW, have you considered using Scalaz or Monix’s Task instead of the standard library’s Future? The most relevant difference is that you don’t pass an ExecutionContext/ExecutorService/whatever when calling “map”, the monad instead just uses the previous thread when mapping and only does a submit to the thread pool on flatMap. Depending on your application’s design, that might solve your multi-transaction problem.