fetch icon indicating copy to clipboard operation
fetch copied to clipboard

Make possible to define timeouts on smaller parts of Fetch and handle timeouts (or other errors)

Open mikkka opened this issue 4 years ago • 1 comments

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.

mikkka avatar Jan 26 '21 05:01 mikkka

I also need this sort of functionality! I'm willing to submit PRs, just need guidance!

zarthross avatar Mar 09 '21 14:03 zarthross