I've implemented the following code to handle the completion of my future, and it compiles fine
resultFuture.onComplete({
case Success => // success logic
case Failure => // failure logic
})
I'm a little confused as to how it works, I'm presuming it does as I copied it from a similar example from the Scala documentation
I understand that onComplete requires a function that takes a Try as input, and that Success and Failure are case classes that extend from Try
What I don't understand is how you can case on these without first performing a match of some type.
How is this possible here?