Skip to content

Allow batch lookups #109

Description

@ruurtjan

Many HTTP APIs have a batch endpoint. This allows multiple values to be requested with a single HTTP call.

This doesn't work well with ZIO-cache right now, as there is no way to look up multiple values at once.

HTTP endpoints are prime targets for caching, since network overhead is usually significant. So I think support for this use case would be a great addition to ZIO-cache.

I'm not sure what the best interface for this would be, but ideally, it would:

  • Use cached values for keys already present in the cache;
  • Call the user-defined batch function with the remaining keys (if any);
  • Add new entries to the cache;
  • Enforce at the type level that the user-defined batch function returns a value for every key.

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