Skip to content

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

Description

@mikkka

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.

Activity

  1. zarthross commented on Mar 9, 2021

    @zarthross

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions