retry takes 3 arguments
- A map m whose keys are exceptions and values are the
number of times to retry the action given that the exception
occurs.
- A handler han that decides how to handle an exception
when the exception cannot be retried.
- The stream itself that we want to run this mechanism on.
When evaluating a stream if an exception occurs,
- The stream evaluation aborts
- The exception is looked up in m
a. If the exception exists and the mapped value is > 0 then,
i. The value is decreased by 1.
ii. The stream is resumed from where the exception was called,
retrying the action.
b. If the exception exists and the mapped value is == 0 then the
stream evaluation stops.
c. If the exception does not exist then we handle the exception using
han.
Internal