Skip to content

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

@mikkka

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.

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