Using Higher Order Functions to Retry Errors In Kotlin

preview_player
Показать описание
Sometimes errors are just 'random'. If they are, and are infrequent enough, then just retrying the operation may be enough to proceed, and we shouldn't bother our users with the failure.

In this episode we first of all write some tests to characterize the errors that we are seeing with the ValueElf service, and then implement a generic functional retry to make them (appear to) go away.

This is Part 47 of an exploration of where a Test Driven Development implementation of the Gilded Rose stock control system might take us in Kotlin. You can see the whole series as a playlist
and the code on GitHub

This sub-series on error handling is also a playlist

If you like this, you’ll probably like the book Java to Kotlin, A Refactoring Guidebook
Рекомендации по теме
Комментарии
Автор

I'm supposed to comment here to generate engagement, but does anyone ever read these?

RefactoringDuncan
Автор

Really liked that episode. Just shows how simple a retry mechanism can be without much overhead.. I feel like this is being forgotten about way too often.

philippmayer
visit shbcf.ru