We can define timeout on entire Fetch after run with cats effect, but I can't find how to define timeout on 'sub' Fetch and handle it with 'default' value. Something like:
(
fetchUser,
fetchPost,
fetchComments.withTimeout(5.secs).handleError(List.empty)
).mapN { (user, post, comments) =>
EntirePost(user, post, comments)
}
So if fetchComments is too long we can cancel fetching it and return partly constructed structure.