Skip to content

compare different types of feedback from "risky operations" aka calls to external services that may fail

License

Notifications You must be signed in to change notification settings

Egga-zz/risky-operations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Risky Operations

Compare different styles to handle calls to external services (aka Risky Operations™).

This is not production code

It is meant as a starting point for discussions. Play around with the code and talk to team members how it makes you feel.

RiskyService

Offers four different methods, which return "nasty" results:

  • null
  • throw a RuntimeException
  • java.util.Optional.empty()
  • io.vavr.control.Either.right()

OurService

Needs to handle the results, transform the data and pass it along to its client.

OurServiceTest

Checks that nasty results haven been handled and repackaged properly.

About

compare different types of feedback from "risky operations" aka calls to external services that may fail

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published