Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mikkka opened this issue Jan 26, 2021 · 1 comment

Comments

@mikkka
Copy link

mikkka commented Jan 26, 2021

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.

@zarthross
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants