Skip to content

Instantly share code, notes, and snippets.

@lforite
Last active March 29, 2020 17:23
Show Gist options
  • Select an option

  • Save lforite/5b50fcbd04ec2293c4365cd09c479e17 to your computer and use it in GitHub Desktop.

Select an option

Save lforite/5b50fcbd04ec2293c4365cd09c479e17 to your computer and use it in GitHub Desktop.
trait ServiceA {
def createA(a: EntityA): Klesli[IO, CorrelationId, _]
}
trait ClientB {
def getB(bId: EntityBID): Klesli[IO, CorrelationId, _]
}
case class ServiceA(clientB: ClientB) extends ServiceA {
override def createA(a: EntityA): Klesli[IO, CorrelationId, _] = {
for {
entityB <- clientB.getB(a.idOfB)
processed <- somePrivateBusinessLogic(entityB)
cid <- Kleisli.ask()
result <- someMoreBusinessLogic(processed)
_ <- logger.info(s"Successfully processed entity ${a.id}")
} yield result
}
}
@domdorn

domdorn commented Mar 29, 2020

Copy link
Copy Markdown

you wrote "Klesli" instead of "Kleisli"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment